|
74 | 74 |
|
75 | 75 | outputs: |
76 | 76 | release_output_url: ${{ steps.release.outputs.url }} |
77 | | - updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}} |
| 77 | + updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}} |
| 78 | + NORMAL_APK_PATH: ${{ steps.update-version.outputs.NORMAL_APK_PATH }} |
| 79 | + FDROID_APK_PATH: ${{ steps.update-version.outputs.FDROID_APK_PATH }} |
78 | 80 | RELEASE_NOTES: ${{ env.RELEASE_NOTES }} |
| 81 | + tag_commit: ${{ steps.check-nightly-tag-force-update.outputs.tag_commit }} |
79 | 82 | steps: |
80 | 83 | - name: Fast Fail if secrets are missing |
81 | 84 | if: ${{ env.KEYSTORE_CONTENT == '' || env.BUILD_JSON_CONTENT == '' }} |
|
216 | 219 | rm $STORE_FILE_PATH $BUILD_JSON_PATH |
217 | 220 | echo "Keystore and build.json removed successfully." |
218 | 221 | |
219 | | - - name: Check Nightly Tag and Force Update |
220 | | - #if: github.event_name == 'push' && contains(github.event.ref, 'tags/nightly') == false |
221 | | - if: ${{ ! inputs.skip_tagging_and_releases }} |
| 222 | + - name: Check Nightly Tag |
| 223 | + if: ${{ !inputs.skip_tagging_and_releases && !inputs.is_PR }} |
222 | 224 | id: check-nightly-tag-force-update |
223 | 225 | run: | |
224 | | - # Check if the nightly tag exists and get the commit it points to |
225 | 226 | if git show-ref --quiet refs/tags/nightly; then |
226 | 227 | TAG_COMMIT=$(git rev-parse nightly) |
227 | 228 | else |
228 | 229 | TAG_COMMIT="" |
229 | 230 | fi |
230 | | - |
231 | | - # If the current commit is the same as the tag, skip updating the tag |
| 231 | +
|
232 | 232 | if [ "$TAG_COMMIT" != "${{ env.GIT_COMMIT }}" ]; then |
233 | | - echo "releaseRequired=true" >> $GITHUB_ENV |
234 | | - # export tag commit before updating for change logs comparing. |
235 | | - echo "TAG_COMMIT=$TAG_COMMIT" >> $GITHUB_ENV |
236 | | - |
237 | | - git config --global user.name 'GitHub Actions' |
238 | | - git config --global user.email 'github-actions@github.com' |
239 | | - git tag -f nightly |
240 | | - git push origin nightly --force |
| 233 | + echo "release_required=true" >> "$GITHUB_OUTPUT" |
241 | 234 | else |
242 | | - echo "Nightly tag already points to this commit. Skipping update." |
| 235 | + echo "release_required=false" >> "$GITHUB_OUTPUT" |
243 | 236 | fi |
| 237 | + echo "tag_commit=$TAG_COMMIT" >> "$GITHUB_OUTPUT" |
| 238 | + |
| 239 | + release: |
| 240 | + needs: build |
| 241 | + runs-on: ubuntu-latest |
| 242 | + if: ${{ github.repository_owner == 'Acode-Foundation' && !inputs.is_PR && !inputs.skip_tagging_and_releases && needs.build.outputs.release_output_url }} |
| 243 | + permissions: |
| 244 | + contents: write |
| 245 | + steps: |
| 246 | + - name: Checkout Repository |
| 247 | + uses: actions/checkout@v7 |
| 248 | + with: |
| 249 | + fetch-depth: 0 |
| 250 | + persist-credentials: true |
244 | 251 |
|
| 252 | + - name: Force-update nightly tag |
| 253 | + run: | |
| 254 | + git config --global user.name 'GitHub Actions' |
| 255 | + git config --global user.email 'github-actions@github.com' |
| 256 | + git tag -f nightly "${{ github.sha }}" |
| 257 | + git push origin nightly --force |
| 258 | +
|
| 259 | + - name: Download APK artifacts |
| 260 | + uses: actions/download-artifact@v7 |
| 261 | + with: |
| 262 | + path: /tmp/artifacts |
| 263 | + |
245 | 264 | # 🚨⚠️ WARNING: the GITHUB_TOKEN under this step, has access to write & read access to Contents, Pull Requests |
246 | 265 | # Which is why, it uses a fine-granted token with Read-Only Access to Public Repos Only. |
247 | 266 | - name: Generate Release Notes (Experimental) |
248 | | - if: ${{ success() && env.releaseRequired == 'true' }} |
249 | 267 | id: gen-release-notes |
250 | 268 | continue-on-error: true |
251 | 269 | run: | |
252 | | - RELEASE_NOTES=$(node utils/scripts/generate-release-notes.js ${{ github.repository_owner }} Acode ${{ github.sha }} --format md --from-tag ${{ env.TAG_COMMIT }} --important-only --quiet --changelog-only) |
253 | | - { |
254 | | - echo "RELEASE_NOTES<<EOF" |
255 | | - echo "$RELEASE_NOTES" |
256 | | - echo "EOF" |
257 | | - } >> $GITHUB_ENV |
258 | | - env: |
| 270 | + RELEASE_NOTES=$(node utils/scripts/generate-release-notes.js ${{ github.repository_owner }} Acode ${{ github.sha }} --format md --from-tag ${{ needs.build.outputs.tag_commit }} --important-only --quiet || true) |
| 271 | + { |
| 272 | + echo "RELEASE_NOTES<<EOF" |
| 273 | + echo "$RELEASE_NOTES" |
| 274 | + echo "EOF" |
| 275 | + } >> $GITHUB_ENV |
| 276 | + env: |
259 | 277 | GITHUB_TOKEN: ${{ secrets.NIGHTLY_RELEASE_NOTES_GH_TOKEN }} |
| 278 | + |
260 | 279 | - name: Release Nightly Version |
261 | | -# Only run this step, if not called from another workflow. And a previous step is successful with releasedRequired=true |
262 | | - id: release |
263 | | - if: ${{ ! inputs.skip_tagging_and_releases && steps.check-nightly-tag-force-update.outcome == 'success' && env.releaseRequired == 'true' && !inputs.is_PR }} |
264 | 280 | uses: softprops/action-gh-release@v3 |
265 | 281 | env: |
266 | 282 | FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true |
267 | 283 | with: |
268 | 284 | prerelease: true |
269 | | - name: ${{ env.UPDATED_VERSION }} |
270 | | - tag_name: ${{ env.UPDATED_VERSION }} |
| 285 | + name: ${{ needs.build.outputs.updated_version }} |
| 286 | + tag_name: ${{ needs.build.outputs.updated_version }} |
271 | 287 | files: | |
272 | | - ${{ env.NORMAL_APK_PATH }} |
273 | | - ${{ env.FDROID_APK_PATH }} |
| 288 | + /tmp/artifacts/**/acode-debug-normal-*.apk |
| 289 | + /tmp/artifacts/**/acode-debug-fdroid-*.apk |
274 | 290 | body: | |
275 | 291 | Automated Nightly (pre-release) Releases for Today |
276 | | - |
277 | | - [Compare Changes](https://github.com/${{ github.repository }}/compare/${{ env.TAG_COMMIT }}...${{ github.sha }}) |
| 292 | +
|
| 293 | + [Compare Changes](https://github.com/${{ github.repository }}/compare/${{ needs.build.outputs.tag_commit }}...${{ github.sha }}) |
278 | 294 |
|
279 | 295 | ${{ env.RELEASE_NOTES }} |
280 | | - |
281 | 296 |
|
282 | 297 | community-release-notifier: |
283 | 298 | needs: build |
|
0 commit comments