3838 required : true
3939
4040jobs :
41- publish :
41+ publish-snapshot :
42+ if : ${{ inputs.snapshot }}
43+ runs-on : ubuntu-latest
44+
45+ steps :
46+ - name : Checkout
47+ uses : actions/checkout@v4
48+ with :
49+ token : ${{ secrets.github-token }}
50+ ref : develop
51+
52+ - name : Bump version
53+ id : bump
54+ uses : GetStream/stream-build-conventions-android/.github/actions/bump-version@develop
55+ with :
56+ bump : ${{ inputs.bump }}
57+ file : ${{ inputs.version-properties-file }}
58+
59+ - name : Setup Gradle
60+ uses : GetStream/stream-build-conventions-android/.github/actions/setup-gradle@develop
61+ with :
62+ cache-read-only : false
63+
64+ - name : Build and publish snapshot
65+ run : ./gradlew publish --no-configuration-cache
66+ env :
67+ ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.maven-central-username }}
68+ ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets.maven-central-password }}
69+ ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets.signing-key }}
70+ ORG_GRADLE_PROJECT_signingInMemoryKeyId : ${{ secrets.signing-key-id }}
71+ ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets.signing-key-password }}
72+ ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED : true
73+ SNAPSHOT : true
74+
75+ publish-release :
76+ if : ${{ !inputs.snapshot }}
4277 runs-on : ubuntu-latest
4378
4479 steps :
@@ -85,15 +120,14 @@ jobs:
85120 push : false
86121
87122 - name : Push changes to ci-release branch
88- if : ${{ !inputs.snapshot }}
89123 run : git push origin HEAD:ci-release --force-with-lease
90124
91125 - name : Setup Gradle
92126 uses : GetStream/stream-build-conventions-android/.github/actions/setup-gradle@develop
93127 with :
94128 cache-read-only : false
95129
96- - name : Build and publish
130+ - name : Build and publish release
97131 run : ./gradlew publish --no-configuration-cache
98132 env :
99133 ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.maven-central-username }}
@@ -102,11 +136,9 @@ jobs:
102136 ORG_GRADLE_PROJECT_signingInMemoryKeyId : ${{ secrets.signing-key-id }}
103137 ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets.signing-key-password }}
104138 ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED : true
105- # todo Make it a gradle property instead?
106- SNAPSHOT : ${{ inputs.snapshot }}
139+ SNAPSHOT : false
107140
108141 - name : Create Github Release
109- if : ${{ !inputs.snapshot }}
110142111143 with :
112144 generateReleaseNotes : true
@@ -117,7 +149,7 @@ jobs:
117149
118150 sync_branches :
119151 if : ${{ !inputs.snapshot }}
120- needs : publish
152+ needs : publish-release
121153 name : Sync main and develop with release
122154 runs-on : ubuntu-latest
123155 steps :
0 commit comments