Skip to content

Commit aa052e6

Browse files
committed
setting maven central
1 parent 385ba89 commit aa052e6

File tree

6 files changed

+210
-16
lines changed

6 files changed

+210
-16
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint:
11+
name: Spotless check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out code
15+
uses: actions/[email protected]
16+
- name: Set up JDK
17+
uses: actions/[email protected]
18+
with:
19+
distribution: zulu
20+
java-version: 17
21+
- uses: gradle/[email protected]
22+
- name: spotless
23+
run: ./gradlew spotlessCheck
24+
25+
build:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/[email protected]
29+
- name: set up JDK
30+
uses: actions/[email protected]
31+
with:
32+
distribution: zulu
33+
java-version: 17
34+
35+
- uses: gradle/[email protected]
36+
- name: Make Gradle executable
37+
run: chmod +x ./gradlew
38+
39+
- name: Build with Gradle
40+
run: |
41+
./gradlew --scan --stacktrace \
42+
assemble
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Snapshot builds
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
name: Snapshot build and publish
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out code
15+
uses: actions/[email protected]
16+
17+
- name: Set up JDK 17
18+
uses: actions/[email protected]
19+
with:
20+
distribution: 'zulu'
21+
java-version: 17
22+
23+
- name: Grant Permission to Execute Gradle
24+
run: chmod +x gradlew
25+
26+
- name: Release build
27+
run: ./gradlew assemble --scan
28+
29+
- name: Publish to MavenCentral
30+
run: |
31+
./gradlew publishAllPublicationsToMavenCentral --no-daemon --no-parallel
32+
env:
33+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
34+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
35+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
36+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
37+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
38+
SNAPSHOT: true

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [ released ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
name: Snapshot build and publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out code
14+
uses: actions/[email protected]
15+
16+
- name: Set up JDK 17
17+
uses: actions/[email protected]
18+
with:
19+
distribution: 'zulu'
20+
java-version: 17
21+
22+
- name: Grant Permission to Execute Gradle
23+
run: chmod +x gradlew
24+
25+
- name: Release build
26+
run: ./gradlew assemble --scan
27+
28+
- name: Publish to MavenCentral
29+
run: |
30+
./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache
31+
env:
32+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
33+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
34+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
35+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
36+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}

gradle.properties

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,71 @@
1-
# Project-wide Gradle settings.
2-
# IDE (e.g. Android Studio) users:
3-
# Gradle settings configured through the IDE *will override*
4-
# any settings specified in this file.
5-
# For more details on how to configure your build environment visit
6-
# http://www.gradle.org/docs/current/userguide/build_environment.html
7-
# Specifies the JVM arguments used for the daemon process.
8-
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1+
#
2+
# Copyright 2023 taewooyo
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory
18+
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dlint.nullness.ignore-deprecated=true
19+
20+
# https://docs.gradle.org/current/userguide/build_cache.html
21+
org.gradle.caching=true
22+
1023
# When configured, Gradle will run in incubating parallel mode.
1124
# This option should only be used with decoupled projects. More details, visit
1225
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13-
# org.gradle.parallel=true
14-
# AndroidX package structure to make it clearer which packages are bundled with the
15-
# Android operating system, and which are packaged with your app's APK
16-
# https://developer.android.com/topic/libraries/support-library/androidx-rn
26+
org.gradle.parallel=true
27+
28+
# Configure only necessary projects, useful with multimodule projects
29+
org.gradle.configureondemand=true
30+
31+
# AndroidX Migration https://developer.android.com/jetpack/androidx/migrate
1732
android.useAndroidX=true
18-
# Kotlin code style for this project: "official" or "obsolete":
19-
kotlin.code.style=official
33+
34+
# Removes uneccessary default build features
35+
android.defaults.buildfeatures.aidl=false
36+
android.defaults.buildfeatures.buildconfig=false
37+
android.defaults.buildfeatures.renderscript=false
38+
android.defaults.buildfeatures.resvalues=false
39+
android.defaults.buildfeatures.shaders=false
40+
2041
# Enables namespacing of each library's R class so that its R class includes only the
2142
# resources declared in the library itself and none from the library's dependencies,
2243
# thereby reducing the size of the R class for that library
23-
android.nonTransitiveRClass=true
44+
# https://developer.android.com/studio/releases/gradle-plugin#4.1-nontransitive-r-class
45+
android.nonTransitiveRClass=true
46+
47+
## Maven Central Publication ##
48+
systemProp.org.gradle.internal.publish.checksums.insecure=true
49+
50+
# Increase timeout when pushing to Sonatype (otherwise we get timeouts)
51+
systemProp.org.gradle.internal.http.socketTimeout=120000
52+
53+
GROUP=io.github.taewooyo
54+
55+
POM_URL=https://github.com/taewooyo/shaker/
56+
POM_SCM_URL=https://github.com/taewooyo/shaker/
57+
POM_SCM_CONNECTION=scm:git:git://github.com/taewooyo/shaker.git
58+
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/taewooyo/shaker.git
59+
60+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
61+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
62+
POM_LICENCE_DIST=repo
63+
64+
POM_DEVELOPER_ID=taewooyo
65+
POM_DEVELOPER_NAME=taewooyo
66+
POM_DEVELOPER_URL=https://github.com/taewooyo/
67+
POM_DEVELOPER_EMAIL=[email protected]
68+
69+
SONATYPE_HOST=S01
70+
RELEASE_SIGNING_ENABLED=true
71+
SONATYPE_AUTOMATIC_RELEASE=true

scripts/publish-module.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import com.taewooyo.buildsrc.Configuration
2+
3+
apply(plugin = "com.vanniktech.maven.publish")
4+
5+
rootProject.extra.apply {
6+
val snapshot = System.getenv("SNAPSHOT").toBoolean()
7+
val libVersion = if (snapshot) {
8+
Configuration.snapshotVersionName
9+
} else {
10+
Configuration.versionName
11+
}
12+
set("libVersion", libVersion)
13+
}

shaker/build.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@ import com.taewooyo.buildsrc.Configuration
44
plugins {
55
id(libs.plugins.android.library.get().pluginId)
66
id(libs.plugins.kotlin.android.get().pluginId)
7+
id(libs.plugins.nexus.plugin.get().pluginId)
8+
}
9+
10+
apply(from = "${rootDir}/scripts/publish-module.gradle.kts")
11+
12+
mavenPublishing {
13+
val artifactId = "shaker"
14+
coordinates(
15+
Configuration.artifactGroup,
16+
artifactId,
17+
rootProject.extra.get("libVersion").toString()
18+
)
19+
20+
pom {
21+
name.set(artifactId)
22+
description.set("Modifier's optimally created rotation, translation, and zoom animations are fully customizable for Android. Only Jetpack Compose is supported.")
23+
}
724
}
825

926
android {

0 commit comments

Comments
 (0)