From fbb4cbc65204648e5b896408d58641791a641f2a Mon Sep 17 00:00:00 2001 From: UnschooledGamer <76094069+UnschooledGamer@users.noreply.github.com> Date: Thu, 9 Jul 2026 13:46:50 +0530 Subject: [PATCH 1/7] feat: enhance nightly build workflow with additional outputs and tagging logic --- .github/workflows/nightly-build.yml | 83 +++++++++++++++++------------ 1 file changed, 49 insertions(+), 34 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 5b2886a0f5..04391630f5 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -74,8 +74,11 @@ outputs: release_output_url: ${{ steps.release.outputs.url }} - updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}} + updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}} + NORMAL_APK_PATH: ${{ steps.update-version.outputs.NORMAL_APK_PATH }} + FDROID_APK_PATH: ${{ steps.update-version.outputs.FDROID_APK_PATH }} RELEASE_NOTES: ${{ env.RELEASE_NOTES }} + tag_commit: ${{ steps.check-nightly-tag-force-update.outputs.tag_commit }} steps: - name: Fast Fail if secrets are missing if: ${{ env.KEYSTORE_CONTENT == '' || env.BUILD_JSON_CONTENT == '' }} @@ -216,68 +219,80 @@ rm $STORE_FILE_PATH $BUILD_JSON_PATH echo "Keystore and build.json removed successfully." - - name: Check Nightly Tag and Force Update - #if: github.event_name == 'push' && contains(github.event.ref, 'tags/nightly') == false - if: ${{ ! inputs.skip_tagging_and_releases }} + - name: Check Nightly Tag + if: ${{ !inputs.skip_tagging_and_releases && !inputs.is_PR }} id: check-nightly-tag-force-update run: | - # Check if the nightly tag exists and get the commit it points to if git show-ref --quiet refs/tags/nightly; then TAG_COMMIT=$(git rev-parse nightly) else TAG_COMMIT="" fi - - # If the current commit is the same as the tag, skip updating the tag + if [ "$TAG_COMMIT" != "${{ env.GIT_COMMIT }}" ]; then - echo "releaseRequired=true" >> $GITHUB_ENV - # export tag commit before updating for change logs comparing. - echo "TAG_COMMIT=$TAG_COMMIT" >> $GITHUB_ENV - - git config --global user.name 'GitHub Actions' - git config --global user.email 'github-actions@github.com' - git tag -f nightly - git push origin nightly --force + echo "release_required=true" >> "$GITHUB_OUTPUT" else - echo "Nightly tag already points to this commit. Skipping update." + echo "release_required=false" >> "$GITHUB_OUTPUT" fi + echo "tag_commit=$TAG_COMMIT" >> "$GITHUB_OUTPUT" + + release: + needs: build + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'Acode-Foundation' && !inputs.is_PR && !inputs.skip_tagging_and_releases && needs.build.outputs.release_output_url }} + permissions: + contents: write + steps: + - name: Checkout Repository + uses: actions/checkout@v7 + with: + fetch-depth: 0 + persist-credentials: true + - name: Force-update nightly tag + run: | + git config --global user.name 'GitHub Actions' + git config --global user.email 'github-actions@github.com' + git tag -f nightly "${{ github.sha }}" + git push origin nightly --force + + - name: Download APK artifacts + uses: actions/download-artifact@v7 + with: + path: /tmp/artifacts + # 🚨⚠️ WARNING: the GITHUB_TOKEN under this step, has access to write & read access to Contents, Pull Requests # Which is why, it uses a fine-granted token with Read-Only Access to Public Repos Only. - name: Generate Release Notes (Experimental) - if: ${{ success() && env.releaseRequired == 'true' }} id: gen-release-notes continue-on-error: true run: | - 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) - { - echo "RELEASE_NOTES<> $GITHUB_ENV - env: + 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) + { + echo "RELEASE_NOTES<> $GITHUB_ENV + env: GITHUB_TOKEN: ${{ secrets.NIGHTLY_RELEASE_NOTES_GH_TOKEN }} + - name: Release Nightly Version -# Only run this step, if not called from another workflow. And a previous step is successful with releasedRequired=true - id: release - if: ${{ ! inputs.skip_tagging_and_releases && steps.check-nightly-tag-force-update.outcome == 'success' && env.releaseRequired == 'true' && !inputs.is_PR }} uses: softprops/action-gh-release@v3 env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true with: prerelease: true - name: ${{ env.UPDATED_VERSION }} - tag_name: ${{ env.UPDATED_VERSION }} + name: ${{ needs.build.outputs.updated_version }} + tag_name: ${{ needs.build.outputs.updated_version }} files: | - ${{ env.NORMAL_APK_PATH }} - ${{ env.FDROID_APK_PATH }} + /tmp/artifacts/**/acode-debug-normal-*.apk + /tmp/artifacts/**/acode-debug-fdroid-*.apk body: | Automated Nightly (pre-release) Releases for Today - - [Compare Changes](https://github.com/${{ github.repository }}/compare/${{ env.TAG_COMMIT }}...${{ github.sha }}) + + [Compare Changes](https://github.com/${{ github.repository }}/compare/${{ needs.build.outputs.tag_commit }}...${{ github.sha }}) ${{ env.RELEASE_NOTES }} - community-release-notifier: needs: build From 79cff76eae87cbc13540584ca754c48ace873197 Mon Sep 17 00:00:00 2001 From: UnschooledGamer <76094069+UnschooledGamer@users.noreply.github.com> Date: Thu, 9 Jul 2026 13:49:40 +0530 Subject: [PATCH 2/7] feat: enhance nightly build workflow with release condition and changelog generation --- .github/workflows/nightly-build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 04391630f5..f456f6389f 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -79,6 +79,7 @@ FDROID_APK_PATH: ${{ steps.update-version.outputs.FDROID_APK_PATH }} RELEASE_NOTES: ${{ env.RELEASE_NOTES }} tag_commit: ${{ steps.check-nightly-tag-force-update.outputs.tag_commit }} + release_required: ${{ steps.check-nightly-tag-force-update.outputs.release_required }} steps: - name: Fast Fail if secrets are missing if: ${{ env.KEYSTORE_CONTENT == '' || env.BUILD_JSON_CONTENT == '' }} @@ -239,7 +240,7 @@ release: needs: build runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'Acode-Foundation' && !inputs.is_PR && !inputs.skip_tagging_and_releases && needs.build.outputs.release_output_url }} + if: ${{ github.repository_owner == 'Acode-Foundation' && !inputs.is_PR && !inputs.skip_tagging_and_releases && needs.build.outputs.release_output_url && needs.build.outputs.release_required == 'true' }} permissions: contents: write steps: @@ -267,7 +268,7 @@ id: gen-release-notes continue-on-error: true run: | - 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) + 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 --changelog-only || true) { echo "RELEASE_NOTES< Date: Thu, 9 Jul 2026 14:34:35 +0530 Subject: [PATCH 3/7] Update nightly-build.yml --- .github/workflows/nightly-build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index f456f6389f..2b9f561bd9 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -72,8 +72,7 @@ contents: write pull-requests: write - outputs: - release_output_url: ${{ steps.release.outputs.url }} + outputs: updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}} NORMAL_APK_PATH: ${{ steps.update-version.outputs.NORMAL_APK_PATH }} FDROID_APK_PATH: ${{ steps.update-version.outputs.FDROID_APK_PATH }} @@ -243,6 +242,9 @@ if: ${{ github.repository_owner == 'Acode-Foundation' && !inputs.is_PR && !inputs.skip_tagging_and_releases && needs.build.outputs.release_output_url && needs.build.outputs.release_required == 'true' }} permissions: contents: write + + outputs: + release_output_url: ${{ steps.release.outputs.url }} steps: - name: Checkout Repository uses: actions/checkout@v7 @@ -296,7 +298,7 @@ ${{ env.RELEASE_NOTES }} community-release-notifier: - needs: build + needs: [build, release] # Run only if push tags, or triggered by a schedule if: ${{ github.repository_owner == 'Acode-Foundation' && (contains(fromJSON('["push", "schedule"]'), github.event_name) || ! inputs.skip_tagging_and_releases) && needs.build.outputs.release_output_url }} uses: Acode-Foundation/acode/.github/workflows/community-release-notifier.yml@main From c7604ce4bbe1186d1c3b1dbd561edde637a5d633 Mon Sep 17 00:00:00 2001 From: Emmanuel Lobo <76094069+UnschooledGamer@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:40:48 +0530 Subject: [PATCH 4/7] Update nightly-build.yml --- .github/workflows/nightly-build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 2b9f561bd9..b4064a9407 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -68,9 +68,7 @@ if: github.repository_owner == 'Acode-Foundation' permissions: -# contents write is needed to create Nightly Releases. - contents: write - pull-requests: write + pull-requests: read outputs: updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}} From dce6556c5653ffd1372d670ee0a851672b72d123 Mon Sep 17 00:00:00 2001 From: Emmanuel Lobo <76094069+UnschooledGamer@users.noreply.github.com> Date: Thu, 9 Jul 2026 14:52:54 +0530 Subject: [PATCH 5/7] Update nightly-build.yml --- .github/workflows/nightly-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index b4064a9407..3f055da4d5 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -74,7 +74,6 @@ updated_version: ${{ steps.update-version.outputs.UPDATED_VERSION}} NORMAL_APK_PATH: ${{ steps.update-version.outputs.NORMAL_APK_PATH }} FDROID_APK_PATH: ${{ steps.update-version.outputs.FDROID_APK_PATH }} - RELEASE_NOTES: ${{ env.RELEASE_NOTES }} tag_commit: ${{ steps.check-nightly-tag-force-update.outputs.tag_commit }} release_required: ${{ steps.check-nightly-tag-force-update.outputs.release_required }} steps: @@ -237,12 +236,13 @@ release: needs: build runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'Acode-Foundation' && !inputs.is_PR && !inputs.skip_tagging_and_releases && needs.build.outputs.release_output_url && needs.build.outputs.release_required == 'true' }} + if: ${{ github.repository_owner == 'Acode-Foundation' && !inputs.is_PR && !inputs.skip_tagging_and_releases && needs.build.outputs.release_required == 'true' }} permissions: contents: write outputs: release_output_url: ${{ steps.release.outputs.url }} + RELEASE_NOTES: ${{ env.RELEASE_NOTES }} steps: - name: Checkout Repository uses: actions/checkout@v7 @@ -301,9 +301,9 @@ if: ${{ github.repository_owner == 'Acode-Foundation' && (contains(fromJSON('["push", "schedule"]'), github.event_name) || ! inputs.skip_tagging_and_releases) && needs.build.outputs.release_output_url }} uses: Acode-Foundation/acode/.github/workflows/community-release-notifier.yml@main with: - tag_name: ${{ needs.build.outputs.updated_version }} - url: ${{ needs.build.outputs.release_output_url }} - body: ${{ needs.build.outputs.RELEASE_NOTES }} + tag_name: ${{ needs.release.outputs.updated_version }} + url: ${{ needs.release.outputs.release_output_url }} + body: ${{ needs.release.outputs.RELEASE_NOTES }} secrets: DISCORD_WEBHOOK_RELEASE_NOTES: ${{ secrets.DISCORD_WEBHOOK_RELEASE_NOTES }} TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} From a276a12a9e26f5c3a45c2e442a9a437148464a8e Mon Sep 17 00:00:00 2001 From: Emmanuel Lobo <76094069+UnschooledGamer@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:07:06 +0530 Subject: [PATCH 6/7] Update .github/workflows/nightly-build.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- .github/workflows/nightly-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 3f055da4d5..0e7e2249b8 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -298,7 +298,7 @@ community-release-notifier: needs: [build, release] # Run only if push tags, or triggered by a schedule - if: ${{ github.repository_owner == 'Acode-Foundation' && (contains(fromJSON('["push", "schedule"]'), github.event_name) || ! inputs.skip_tagging_and_releases) && needs.build.outputs.release_output_url }} + if: ${{ github.repository_owner == 'Acode-Foundation' && (contains(fromJSON('["push", "schedule"]'), github.event_name) || ! inputs.skip_tagging_and_releases) && needs.release.outputs.release_output_url }} uses: Acode-Foundation/acode/.github/workflows/community-release-notifier.yml@main with: tag_name: ${{ needs.release.outputs.updated_version }} From 7f472cacb0ec45b6e95169f6604368f11a8e2e67 Mon Sep 17 00:00:00 2001 From: Emmanuel Lobo <76094069+UnschooledGamer@users.noreply.github.com> Date: Thu, 9 Jul 2026 15:07:25 +0530 Subject: [PATCH 7/7] Update .github/workflows/nightly-build.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- .github/workflows/nightly-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 0e7e2249b8..3f537dcfb3 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -301,7 +301,7 @@ if: ${{ github.repository_owner == 'Acode-Foundation' && (contains(fromJSON('["push", "schedule"]'), github.event_name) || ! inputs.skip_tagging_and_releases) && needs.release.outputs.release_output_url }} uses: Acode-Foundation/acode/.github/workflows/community-release-notifier.yml@main with: - tag_name: ${{ needs.release.outputs.updated_version }} + tag_name: ${{ needs.build.outputs.updated_version }} url: ${{ needs.release.outputs.release_output_url }} body: ${{ needs.release.outputs.RELEASE_NOTES }} secrets: