From 834426630ead6313137461b1b4457882192e0105 Mon Sep 17 00:00:00 2001 From: test Date: Mon, 24 Aug 2026 21:09:52 +0000 Subject: [PATCH 1/2] ci(release): generate GitHub release notes instead of shipping an empty body The release-gh job created releases with no description: body_path was commented out and nothing generated the file it pointed at. v0.14.0b2 shipped to the Play Store stable channel with an empty changelog. Wire up the same generator the main ActivityWatch and gptme repos use. build_changelog.py explicitly supports cross-repo reuse (see its module docstring), so check it out from ActivityWatch/activitywatch rather than vendoring a copy that would drift. The job previously never checked out the repo at all, so add a checkout with full history/tags (needed to resolve the previous release tag and walk the commit range) before download-artifact, which cleans the workspace. get_latest_release.sh filters out the tag being released, so it resolves to the previous release; STABLE_ONLY makes a stable release diff against the last stable one rather than the last beta. Falls back to the nearest ancestor tag when no prior release matches. Verified locally against the real v0.14.0b1...v0.14.0b2 range: produces a contributor list and a categorized changelog of all 9 commits. Refs ActivityWatch/aw-android#236 --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d76eb08e..74b2a5b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -447,6 +447,25 @@ jobs: runs-on: ubuntu-latest steps: + # Needed for changelog generation: full history + tags, and the submodule + # pointers build_changelog.py summarizes (aw-server-rust). + # Must run before download-artifact, since checkout cleans the workspace. + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + # build_changelog.py is maintained in ActivityWatch/activitywatch and is + # explicitly designed to be reused by other repos (see its module docstring). + # Check it out rather than vendoring a copy that would drift. + - name: Checkout changelog tooling + uses: actions/checkout@v4 + with: + repository: ActivityWatch/activitywatch + path: .changelog-tools + sparse-checkout: scripts + fetch-depth: 1 + # Will download all artifacts to path - name: Download release APK & AAB uses: actions/download-artifact@v4 @@ -465,6 +484,34 @@ jobs: with: prefix: 'v' + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install changelog deps + run: pip install requests + + - name: Generate release notes + run: | + # get_latest_release.sh excludes the tag being released, so this + # resolves to the previous release. STABLE_ONLY makes a stable release + # diff against the last stable one rather than the last beta. + LAST_RELEASE=$(STABLE_ONLY=${{ steps.version.outputs.is_stable }} \ + .changelog-tools/scripts/get_latest_release.sh) + if [ -z "$LAST_RELEASE" ]; then + echo "No previous release tag found; falling back to nearest ancestor tag." + LAST_RELEASE=$(git describe --tags --abbrev=0 \ + --exclude "$GITHUB_REF_NAME" "$GITHUB_REF_NAME") + fi + echo "Generating changelog for $LAST_RELEASE...$GITHUB_REF_NAME" + python3 .changelog-tools/scripts/build_changelog.py \ + --org ActivityWatch --repo aw-android \ + --project-title "ActivityWatch for Android" \ + --range "$LAST_RELEASE...$GITHUB_REF_NAME" \ + --output release_notes.md + cat release_notes.md + # create a release - name: Release uses: softprops/action-gh-release@v2 @@ -474,4 +521,4 @@ jobs: files: | dist/*.apk dist/*.aab - # body_path: dist/release_notes/release_notes.md + body_path: release_notes.md From df7e0622050151c196e9a96fb6382b082ad4dcd3 Mon Sep 17 00:00:00 2001 From: test Date: Mon, 24 Aug 2026 21:18:52 +0000 Subject: [PATCH 2/2] fix(release-gh): pin activitywatch checkout + fix 0.x.x stable detection for changelog P1: check-version-format-action classifies 0.x.x as not stable (semver convention), so STABLE_ONLY got 'false' on a stable release, causing the changelog to diff against the last beta instead of the last stable. Mirror the release-play job's regex check instead. P2: pin the activitywatch checkout to a known-good commit rather than tracking the default branch, so release-capable jobs don't execute from an unreviewed upstream revision. Addresses Greptile P1 + P2 findings on PR #238. --- .github/workflows/build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74b2a5b6..bfedb4b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -458,10 +458,13 @@ jobs: # build_changelog.py is maintained in ActivityWatch/activitywatch and is # explicitly designed to be reused by other repos (see its module docstring). # Check it out rather than vendoring a copy that would drift. + # Pinned to a known-good commit (2026-08-24) to avoid executing unpinned + # upstream scripts inside a release-capable job. - name: Checkout changelog tooling uses: actions/checkout@v4 with: repository: ActivityWatch/activitywatch + ref: a17fa8aff7465268973a10d7d43aeb6741492e03 path: .changelog-tools sparse-checkout: scripts fetch-depth: 1 @@ -497,7 +500,17 @@ jobs: # get_latest_release.sh excludes the tag being released, so this # resolves to the previous release. STABLE_ONLY makes a stable release # diff against the last stable one rather than the last beta. - LAST_RELEASE=$(STABLE_ONLY=${{ steps.version.outputs.is_stable }} \ + # NOTE: check-version-format-action classifies 0.x.x as not stable per + # semver, but aw-android uses 0.x.x for production releases. Use the + # same regex the release-play job uses to detect stability correctly. + TAG="${{ github.ref_name }}" + VERSION="${TAG#v}" + if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + IS_STABLE="true" + else + IS_STABLE="false" + fi + LAST_RELEASE=$(STABLE_ONLY=${IS_STABLE} \ .changelog-tools/scripts/get_latest_release.sh) if [ -z "$LAST_RELEASE" ]; then echo "No previous release tag found; falling back to nearest ancestor tag."