File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -32,12 +32,7 @@ workflows:
32
32
when :
33
33
not : << pipeline.parameters.mapbox_navigation_native_upstream >>
34
34
jobs :
35
- - release-snapshot :
36
- filters :
37
- branches :
38
- only :
39
- - main
40
- - /release-v.*/
35
+ - release-snapshot
41
36
- release :
42
37
filters :
43
38
tags :
@@ -101,6 +96,20 @@ workflows:
101
96
# ---------- COMMANDS ----------
102
97
# ------------------------------
103
98
commands :
99
+ check-snapshot-label :
100
+ steps :
101
+ - run :
102
+ name : Check snapshot label
103
+ command : |
104
+ if [[ -n "$CIRCLE_PULL_REQUEST" ]]; then
105
+ PR=$(curl -s $CIRCLE_PULL_REQUEST)
106
+ fi
107
+ if [[ $CIRCLE_BRANCH == main || $CIRCLE_BRANCH =~ release-v.* || $PR == *"mapbox/mapbox-navigation-android/labels/publish-snapshot"* ]]; then
108
+ exit 0
109
+ else
110
+ exit 1
111
+ fi
112
+
104
113
write-workspace :
105
114
steps :
106
115
- persist_to_workspace :
@@ -768,6 +777,7 @@ jobs:
768
777
executor : ndk-r22-latest-executor
769
778
resource_class : medium+
770
779
steps :
780
+ - check-snapshot-label
771
781
- checkout
772
782
- assemble-core-release
773
783
- assemble-ui-release
Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ def getSnapshotVersion(String version) {
52
52
if (! isPreRelease) {
53
53
minor + = 1
54
54
}
55
- return " ${ major} .${ minor} .0-SNAPSHOT"
55
+ def branch = System . getenv(" CIRCLE_BRANCH" )
56
+ if (! branch || branch == " main" || branch ==~ / release-v.*/ ) {
57
+ return " ${ major} .${ minor} .0-SNAPSHOT"
58
+ } else {
59
+ return " ${ major} .${ minor} .0-${ branch} -SNAPSHOT"
60
+ }
56
61
}
57
62
}
You can’t perform that action at this time.
0 commit comments