Skip to content

Commit 4d00897

Browse files
committed
build: migrate to modern Kotlin DSL + Maven Central release flow
1 parent 632993d commit 4d00897

File tree

18 files changed

+192
-138
lines changed

18 files changed

+192
-138
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
name: Build
2-
on: [pull_request, push]
2+
3+
on:
4+
push:
5+
pull_request:
6+
37
jobs:
48
build:
59
runs-on: ubuntu-latest
10+
611
steps:
7-
- name: Checkout the code
8-
uses: actions/checkout@v2
9-
- name: Build the app
10-
run: chmod +x gradlew && ./gradlew build
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Configure JDK
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: zulu
19+
java-version: '17'
20+
cache: gradle
21+
22+
- name: Validate Gradle Wrapper
23+
uses: gradle/actions/wrapper-validation@v4
24+
25+
- name: Build
26+
run: ./gradlew build
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
env:
9+
RELEASE_SIGNING_ENABLED: true
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'Commit451/ModalBottomSheetDialogFragment'
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: zulu
24+
java-version: '17'
25+
cache: gradle
26+
27+
- name: Release to Maven Central
28+
run: ./gradlew publishAndReleaseToMavenCentral -PVERSION_NAME="${GITHUB_REF_NAME}" --no-configuration-cache
29+
env:
30+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
31+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
32+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
33+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

.jitpack.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
# ModalBottomSheetDialogFragment
22
Modal bottom sheet dialog based on the [Material Guidelines](https://material.io/components/sheets-bottom)
33

4-
[![](https://jitpack.io/v/Commit451/ModalBottomSheetDialogFragment.svg)](https://jitpack.io/#Commit451/ModalBottomSheetDialogFragment)
4+
[![Build](https://github.com/Commit451/ModalBottomSheetDialogFragment/actions/workflows/ci.yml/badge.svg)](https://github.com/Commit451/ModalBottomSheetDialogFragment/actions/workflows/ci.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.commit451/modalbottomsheetdialogfragment.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.commit451/modalbottomsheetdialogfragment)
55

66
<img src="/art/simple.png?raw=true" width="200px"> <img src="/art/header.png?raw=true" width="200px"> <img src="/art/custom.png?raw=true" width="200px">
77

88
## Dependency
99

10-
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
10+
Add the library to your project `build.gradle`:
1111

12-
```gradle
13-
allprojects {
14-
repositories {
15-
...
16-
maven { url "https://jitpack.io" }
17-
}
18-
}
19-
```
20-
21-
Then, add the library to your project `build.gradle`
2212
```gradle
2313
dependencies {
24-
implementation("com.github.Commit451:ModalBottomSheetDialogFragment:latest.version.here")
14+
implementation("com.commit451:modalbottomsheetdialogfragment:latest.version.here")
2515
}
2616
```
2717

app/build.gradle

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
plugins {
2+
id("com.android.application")
3+
}
4+
5+
android {
6+
namespace = "com.commit451.modalbottomsheetdialogfragment.sample"
7+
compileSdk = 35
8+
9+
defaultConfig {
10+
applicationId = "com.commit451.modalbottomsheetdialogfragment.sample"
11+
minSdk = 21
12+
targetSdk = 35
13+
versionCode = 1
14+
versionName = "1.0"
15+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
16+
}
17+
18+
buildFeatures {
19+
viewBinding = true
20+
}
21+
22+
buildTypes {
23+
release {
24+
isMinifyEnabled = false
25+
proguardFiles(
26+
getDefaultProguardFile("proguard-android-optimize.txt"),
27+
"proguard-rules.pro"
28+
)
29+
}
30+
}
31+
32+
compileOptions {
33+
sourceCompatibility = JavaVersion.VERSION_17
34+
targetCompatibility = JavaVersion.VERSION_17
35+
}
36+
}
37+
38+
dependencies {
39+
implementation("androidx.appcompat:appcompat:1.7.1")
40+
41+
implementation(project(":modalbottomsheetdialogfragment"))
42+
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.commit451.modalbottomsheetdialogfragment.sample">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application
65
android:allowBackup="true"
@@ -20,4 +19,4 @@
2019
</activity>
2120
</application>
2221

23-
</manifest>
22+
</manifest>

build.gradle

Lines changed: 0 additions & 27 deletions
This file was deleted.

build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
id("com.android.application") version "9.1.0" apply false
3+
id("com.android.library") version "9.1.0" apply false
4+
id("com.vanniktech.maven.publish") version "0.30.0" apply false
5+
}
6+
7+
tasks.register<Delete>("clean") {
8+
delete(rootProject.layout.buildDirectory)
9+
}

gradle.properties

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
1-
# Project-wide Gradle settings.
2-
3-
# IDE (e.g. Android Studio) users:
4-
# Gradle settings configured through the IDE *will override*
5-
# any settings specified in this file.
6-
7-
# For more details on how to configure your build environment visit
8-
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
10-
# Specifies the JVM arguments used for the daemon process.
11-
# The setting is particularly useful for tweaking memory settings.
12-
org.gradle.jvmargs=-Xmx1536m
13-
14-
# When configured, Gradle will run in incubating parallel mode.
15-
# This option should only be used with decoupled projects. More details, visit
16-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17-
# org.gradle.parallel=true
1+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
182
android.useAndroidX=true
193

20-
GROUP=com.commit451.modalbottomsheetdialogfragment
4+
GROUP=com.commit451
215
POM_ARTIFACT_ID=modalbottomsheetdialogfragment
22-
VERSION_NAME=1.0.0
6+
VERSION_NAME=1.3.1
237

24-
POM_NAME=Aloy
8+
POM_NAME=ModalBottomSheetDialogFragment
259
POM_DESCRIPTION=Modal bottom sheet dialog based on the Material Guidelines
2610
POM_INCEPTION_YEAR=2018
2711
POM_URL=https://github.com/Commit451/ModalBottomSheetDialogFragment/
@@ -30,12 +14,13 @@ POM_LICENSE_NAME=The Apache Software License, Version 2.0
3014
POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
3115
POM_LICENSE_DIST=repo
3216

33-
POM_SCM_URL=https://github.com/Commit451/Aloy/
17+
POM_SCM_URL=https://github.com/Commit451/ModalBottomSheetDialogFragment/
3418
POM_SCM_CONNECTION=scm:git:git://github.com/Commit451/ModalBottomSheetDialogFragment.git
3519
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Commit451/ModalBottomSheetDialogFragment.git
3620

3721
POM_DEVELOPER_ID=Commit451
3822
POM_DEVELOPER_NAME=Commit 451
3923
POM_DEVELOPER_URL=https://github.com/Commit451/
4024

41-
RELEASE_SIGNING_ENABLED=false
25+
SONATYPE_CONNECT_TIMEOUT_SECONDS=60
26+
SONATYPE_CLOSE_TIMEOUT_SECONDS=900

0 commit comments

Comments
 (0)