File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ variables:
44
55stages :
66 - build
7+ - deploy
78
89default :
910 image : ${CI_IMAGE}:${CI_IMAGE_VER} # set in CI env vars
Original file line number Diff line number Diff line change 1+ # maven credentials and gpg settings
2+ # in runner's ~/.gradle/gradle.properties
3+ publish_to_maven :
4+ stage : deploy
5+ tags :
6+ - m4
7+ rules :
8+ - if : " $CI_COMMIT_TAG"
9+ when : manual
10+ needs : []
11+ script :
12+ - cd libs/gl-sdk-android
13+ - ./gradlew publish --no-daemon
14+ artifacts :
15+ paths :
16+ - libs/gl-sdk-android/lib/build/libs
17+ - libs/gl-sdk-android/lib/build/outputs
18+ - libs/gl-sdk-android/lib/build/publications
19+ when : always
20+ expire_in : 7 days
21+ allow_failure : true
22+
23+ publish_snapshot_to_maven :
24+ stage : deploy
25+ tags :
26+ - m4
27+ needs : []
28+ rules :
29+ - if : ' $CI_COMMIT_BRANCH == "main"'
30+ when : on_success
31+ script :
32+ - cd libs/gl-sdk-android
33+ - RAW_VERSION=$(grep '^libraryVersion=' gradle.properties | cut -d'=' -f2)
34+ - BASE_VERSION=${RAW_VERSION%-SNAPSHOT}
35+ - VERSION_CORE=$(echo "$BASE_VERSION" | sed -E 's/[^0-9.].*$//')
36+ - IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION_CORE"
37+ - MAJOR=${MAJOR:-0}
38+ - MINOR=${MINOR:-0}
39+ - PATCH=${PATCH:-0}
40+ - NEXT_PATCH=$((PATCH + 1))
41+ - NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}"
42+ - SNAPSHOT_VERSION="${NEXT_VERSION}-SNAPSHOT"
43+ - echo "Publishing snapshot version ${SNAPSHOT_VERSION} (base=${BASE_VERSION})"
44+ - ./gradlew -PlibraryVersion=${SNAPSHOT_VERSION} publish --no-daemon
45+ artifacts :
46+ paths :
47+ - libs/gl-sdk-android/lib/build/libs
48+ - libs/gl-sdk-android/lib/build/outputs
49+ - libs/gl-sdk-android/lib/build/publications
50+ when : always
51+ expire_in : 7 days
52+ allow_failure : true
Original file line number Diff line number Diff line change @@ -136,8 +136,8 @@ mavenPublishing {
136136 }
137137 }
138138
139- // publishToMavenCentral()
140- // signAllPublications()
139+ publishToMavenCentral()
140+ signAllPublications()
141141}
142142
143143extensions.configure<SigningExtension > {
@@ -152,4 +152,4 @@ tasks.withType<Sign>().configureEach {
152152 // Skip signing if the build is targeting the local Maven repository
153153 taskNames.none { it.contains(" publishToMavenLocal" , ignoreCase = true ) || it.contains(" publishToLocalMaven" , ignoreCase = true ) }
154154 }
155- }
155+ }
You can’t perform that action at this time.
0 commit comments