-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathdeploy-maven.yml
More file actions
69 lines (67 loc) · 1.9 KB
/
deploy-maven.yml
File metadata and controls
69 lines (67 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
build_kotlin:
stage: build
tags:
- m4
rules:
- if: "$CI_COMMIT_TAG"
- if: '$CI_COMMIT_BRANCH == "main"'
script:
- task build:kotlin
artifacts:
paths:
- libs/gl-sdk-android/lib/src/androidMain/jniLibs
- libs/gl-sdk-android/lib/src/androidMain/kotlin
- libs/gl-sdk-android/lib/src/jvmMain
- libs/gl-sdk-android/lib/src/lib
- libs/gl-sdk-android/lib/src/commonMain
- libs/gl-sdk-android/lib/src/nativeMain
- libs/gl-sdk-android/lib/src/nativeInterop
expire_in: 1 day
# maven credentials and gpg settings
# in runner's ~/.gradle/gradle.properties
publish_to_maven:
stage: deploy
tags:
- m4
rules:
- if: "$CI_COMMIT_TAG"
when: manual
needs:
- job: build_kotlin
artifacts: true
script:
- cd libs/gl-sdk-android
- ./gradlew publish --no-daemon
artifacts:
paths:
- libs/gl-sdk-android/lib/build/libs
- libs/gl-sdk-android/lib/build/outputs
- libs/gl-sdk-android/lib/build/publications
when: always
expire_in: 7 days
allow_failure: true
publish_snapshot_to_maven:
stage: deploy
tags:
- m4
needs:
- job: build_kotlin
artifacts: true
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: manual
script:
- cd libs/gl-sdk-android
- RAW_VERSION=$(grep '^libraryVersion=' gradle.properties | cut -d'=' -f2)
- BASE_VERSION=${RAW_VERSION%-SNAPSHOT}
- VERSION_CORE=$(echo "$BASE_VERSION" | sed -E 's/[^0-9.].*$//')
- IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION_CORE"
- MAJOR=${MAJOR:-0}
- MINOR=${MINOR:-0}
- PATCH=${PATCH:-0}
- NEXT_PATCH=$((PATCH + 1))
- NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}"
- SNAPSHOT_VERSION="${NEXT_VERSION}-SNAPSHOT"
- echo "Publishing snapshot version ${SNAPSHOT_VERSION} (base=${BASE_VERSION})"
- ./gradlew -PlibraryVersion=${SNAPSHOT_VERSION} publish --no-daemon
allow_failure: true