Skip to content

Commit 05ccd42

Browse files
angelixcdecker
authored andcommitted
ci(deploy-maven): fix snapshot version and trigger rules
Use CI_COMMIT_SHORT_SHA (GitLab) instead of GIT_COMMIT (Jenkins), which was empty and produced "0.2.1--SNAPSHOT". Drop the MR rule since this repo runs in clone mode, and auto-publish snapshots on any branch.
1 parent da3fdf4 commit 05ccd42

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

gitlab/deploy-maven.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ publish_snapshot_to_maven:
5050
- job: build_kotlin
5151
artifacts: true
5252
rules:
53-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
54-
when: never
55-
- if: '$CI_COMMIT_BRANCH == "master"'
56-
when: on_success
5753
- if: '$CI_COMMIT_BRANCH'
58-
when: manual
54+
when: on_success
5955
script:
6056
- cd libs/gl-sdk-android
6157
- RAW_VERSION=$(grep '^libraryVersion=' gradle.properties | cut -d'=' -f2)
@@ -68,7 +64,7 @@ publish_snapshot_to_maven:
6864
- NEXT_PATCH=$((PATCH + 1))
6965
- NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}"
7066
- SNAPSHOT_VERSION="${NEXT_VERSION}-SNAPSHOT"
71-
- SNAPSHOT_VERSION_COMMIT="${NEXT_VERSION}-${GIT_COMMIT}-SNAPSHOT"
67+
- SNAPSHOT_VERSION_COMMIT="${NEXT_VERSION}-${CI_COMMIT_SHORT_SHA}-SNAPSHOT"
7268
- |
7369
if [ "$CI_COMMIT_BRANCH" = "master" ]; then
7470
echo "Publishing snapshot versions ${SNAPSHOT_VERSION}"

0 commit comments

Comments
 (0)