From 6b728c3c777ac14cd6624d4ff78853297c49caa8 Mon Sep 17 00:00:00 2001 From: Inhishonor Date: Sat, 24 Jan 2026 15:50:59 -0800 Subject: [PATCH 1/4] Pass the version bump to the pull request job --- .github/workflows/manual-release.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index c17b01d9..38ac96c7 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -94,6 +94,12 @@ jobs: output_file.write(f"new_version_code={new_code}\n") PY + - name: Upload modified Gradle file + uses: actions/upload-artifact@v4 + with: + name: version-bump-artifact + path: presentation/build.gradle + generate_release_notes: needs: bump-version uses: ./.github/workflows/generate-release-notes.yml @@ -111,6 +117,12 @@ jobs: fetch-depth: 0 persist-credentials: true + - name: Download modified Gradle file + uses: actions/download-artifact@v4 + with: + name: version-bump-artifact + path: presentation/ + - name: Open release PR uses: peter-evans/create-pull-request@v7 with: From ef765c098650ee8d360c69d4093739537472d84c Mon Sep 17 00:00:00 2001 From: Inhishonor Date: Sat, 24 Jan 2026 17:58:39 -0800 Subject: [PATCH 2/4] Create and upload a changelog.json with release --- .github/workflows/manual-release.yml | 96 +++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index 38ac96c7..7501badd 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -94,7 +94,7 @@ jobs: output_file.write(f"new_version_code={new_code}\n") PY - - name: Upload modified Gradle file + - name: Upload modified build.gradle uses: actions/upload-artifact@v4 with: name: version-bump-artifact @@ -106,7 +106,7 @@ jobs: with: version_name: ${{ needs.bump-version.outputs.new_version_name }} - open_release_pr: + generate_app_changelog: needs: [bump-version, generate_release_notes] runs-on: ubuntu-latest @@ -117,12 +117,102 @@ jobs: fetch-depth: 0 persist-credentials: true - - name: Download modified Gradle file + - name: Prepare release notes + id: prepare_notes + env: + NOTES: ${{ needs.generate_release_notes.outputs.release_notes }} + run: | + set -euo pipefail + python3 <<'PY' + import os, re, pathlib + notes = os.environ.get("NOTES", "") + clean = re.sub( + r'(?im)^\s*by\s+\S+\s+in\s+.*$', + '', + re.sub(r'(?im)^\s*["\']?\*\*Full\s+Changelog\*\*\s*:\s*.*$', '', notes) + ).rstrip() + + pathlib.Path("sanitized_notes.txt").write_text(clean) + PY + { + echo "clean_notes<> "$GITHUB_OUTPUT" + + - name: Add to changelog.json + env: + VERSION_NAME: ${{ needs.bump-version.outputs.new_version_name }} + VERSION_CODE: ${{ needs.bump-version.outputs.new_version_code }} + CLEAN_NOTES: ${{ steps.prepare_notes.outputs.clean_notes }} + run: | + set -euo pipefail + + python3 <<'PY' + import json + import os + from pathlib import Path + + changelog_path = Path("data/src/main/assets/changelog.json") + + version_name = os.environ["VERSION_NAME"] + version_code = int(os.environ["VERSION_CODE"]) + notes_raw = os.environ.get("CLEAN_NOTES", "") + + notes = [ + line.strip() + for line in notes_raw.splitlines() + if line.strip() + ] + + if changelog_path.exists(): + changelog = json.loads(changelog_path.read_text()) + else: + changelog = [] + + new_entry = { + "versionCode": version_code, + "versionName": version_name, + "fixed": notes + } + + changelog.insert(0, new_entry) + + changelog_path.write_text( + json.dumps(changelog, indent=2, ensure_ascii=False) + "\n" + ) + PY + + - name: Upload changelog.json + uses: actions/upload-artifact@v4 + with: + name: changelog-json-artifact + path: data/src/main/assets/changelog.json + + open_release_pr: + needs: [bump-version, generate_release_notes, generate_app_changelog] + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: true + + - name: Download modified build.gradle uses: actions/download-artifact@v4 with: name: version-bump-artifact path: presentation/ + - name: Download modified changelog + uses: actions/download-artifact@v4 + with: + name: changelog-json-artifact + path: data/src/main/assets/ + - name: Open release PR uses: peter-evans/create-pull-request@v7 with: From acd135cc1277a0a21cf2219442098b920338cc33 Mon Sep 17 00:00:00 2001 From: Inhishonor Date: Sun, 25 Jan 2026 06:29:23 -0800 Subject: [PATCH 3/4] Reapply fix for the missing delimiter in build and release --- .github/workflows/build-and-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index f4f12f24..bb9ab9b0 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -201,6 +201,7 @@ jobs: { echo "clean_notes<> "$GITHUB_OUTPUT" From 91979ee5ebae832f1f4b2b4036492f1f8204dfe0 Mon Sep 17 00:00:00 2001 From: Inhishonor Date: Sun, 25 Jan 2026 06:50:09 -0800 Subject: [PATCH 4/4] Upload all release artifacts so they can be referenced from later jobs --- .github/workflows/build-and-release.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index bb9ab9b0..eea562ed 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -174,6 +174,15 @@ jobs: find . -name '*.apk' -type f -exec sha256sum {} \; > checksums.txt echo "checksums_path=checksums.txt" >> "$GITHUB_OUTPUT" + - name: Upload all build outputs + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: | + ${{ steps.release_artifact.outputs.apk_release_path }} + ${{ steps.fdroid_artifact.outputs.apk_fdroid_path }} + ${{ steps.checksums.outputs.checksums_path }} + generate_release_notes: needs: build uses: ./.github/workflows/generate-release-notes.yml @@ -205,6 +214,12 @@ jobs: echo "EOF" } >> "$GITHUB_OUTPUT" + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: downloaded/ + - name: Publish GitHub release uses: softprops/action-gh-release@v2 with: @@ -214,9 +229,8 @@ jobs: prerelease: ${{ inputs.prerelease }} body: ${{ steps.clean_notes.outputs.clean_notes }} files: | - ${{ needs.build.outputs.apk_release_path }} - ${{ needs.build.outputs.apk_fdroid_path }} - ${{ needs.build.outputs.checksums_path }} + downloaded/**/*.apk + downloaded/*.txt fail_on_unmatched_files: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}