refactor(ci): unify build and release workflows#1313
Conversation
6664f21 to
503830d
Compare
|
Rebased this draft PR on bf66fa6 and force-pushed 503830d. Conflict resolution: the three old workflow files are still intentionally deleted, and I ported the new upstream workflow fixes into Local validation: |
Greptile SummaryThis PR consolidates three separate GitHub Actions workflow files (
Confidence Score: 5/5Safe to merge; the refactor faithfully preserves all build, test, package, and release logic from the three deleted files. All build and release phases use correct .github/workflows/release.yml — specifically the top-level Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
trigger([Workflow trigger]) --> schedCheck{schedule or\nworkflow_dispatch?}
trigger --> pushCheck{push or\npull_request?}
schedCheck -- yes --> preflight[preflight\nPre-flight checks]
preflight -- should_release=true --> createTag[create-tag\nCreate dev release tag]
createTag -- pushes tag --> tagPush([Tag push triggers\nnew workflow run])
schedCheck -- no --> skip1([skip preflight/create-tag])
pushCheck -- yes, tag push --> buildQt[build-qt\nQt build matrix\nubuntu / windows / macos]
pushCheck -- yes, tag push --> buildTauri[build-tauri\nTauri build matrix\nubuntu / ubuntu-arm / windows / macos]
pushCheck -- yes, tag push --> relNotes[release-notes\nGenerate changelog]
pushCheck -- yes, non-tag push/PR --> buildQt2[build-qt + build-tauri\nCI only, no release]
pushCheck -- no --> skip2([skip build jobs])
buildQt --> release[release\nPublish draft release\non softprops/action-gh-release]
buildTauri --> release
relNotes --> release
tagPush --> trigger
Reviews (2): Last reviewed commit: "refactor(ci): unify release workflows" | Re-trigger Greptile |
| libxrender-dev | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| if [ "$RUNNER_OS" == "Windows" ]; then | ||
| choco install innosetup | ||
| fi | ||
| pip3 install poetry==1.4.2 | ||
|
|
||
| - name: Build | ||
| run: | | ||
| python3 -m venv venv | ||
| source venv/bin/activate || source venv/Scripts/activate | ||
| poetry install | ||
| make build SKIP_WEBUI=${{ matrix.skip_webui }} SKIP_SERVER_RUST=${{ matrix.skip_rust }} | ||
| pip freeze | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| source venv/bin/activate || source venv/Scripts/activate | ||
| make test SKIP_SERVER_RUST=${{ matrix.skip_rust }} |
There was a problem hiding this comment.
macOS DMG filename collision in unified release
Both build-qt (line 352) and build-tauri (line 532) rename their macOS output to the identical pattern activitywatch-${VERSION_TAG:-...}-macos-x86_64.dmg. They are uploaded to different artifact containers (builds-macos-14-py3.9 vs builds-tauri-macos-14-py3.9), but when the release job's dist/*/activitywatch-*.* glob collects them both, softprops/action-gh-release@v2 will attempt to upload two assets with the same basename to a single GitHub release, which will either error out or silently overwrite one. The PR description claims distinctness via a activitywatch-tauri-… prefix, but the actual mv command in build-tauri's "Package dmg" step (line 532) produces the same name as build-qt's. If the Makefile or Tauri packaging path never actually creates dist/ActivityWatch.dmg when TAURI_BUILD=true, the step is dead code and the collision never occurs — but that assumption is invisible from the workflow file alone and should be made explicit.
There was a problem hiding this comment.
The DMG names are already distinct at the actual command. Qt produces activitywatch-${VERSION_WITH_V}-macos-$(uname -m).dmg (line 385) and Tauri produces activitywatch-tauri-${VERSION_WITH_V}-macos-$(uname -m).dmg (line 603). The tauri- prefix is present in the final rename — so when the release job's glob collects both artifact sets, the basenames are distinct and softprops/action-gh-release won't see a collision.
Two other corrections on the review's framing: the variable is VERSION_WITH_V (not VERSION_TAG), and the architecture suffix is dynamic ($(uname -m)) rather than hardcoded to x86_64.
|
|
||
| source venv/bin/activate | ||
| make dist/ActivityWatch.dmg | ||
|
|
There was a problem hiding this comment.
Single platform failure in either matrix blocks the entire combined release
In the old split design, build.yml and build-tauri.yml each had independent release jobs, so a flaky Tauri build on one platform only blocked the Tauri release while Qt artifacts were still published. With needs: [build-qt, build-tauri, release-notes], a single flaky matrix run in either of the 9 total build jobs (4 Qt + 5 Tauri) now blocks publishing any artifacts at all. If build-tauri's ubuntu-24.04-arm job is unstable, the combined release will never be published. Consider whether continue-on-error at the matrix level or a separate release step per build group better matches the desired failure semantics.
There was a problem hiding this comment.
Acknowledged — this is an intentional trade-off. The old split design did mean a flaky Tauri platform left Qt artifacts publishable independently, so the combined needs: [build-qt, build-tauri, release-notes] gate does tighten the coupling.
The rationale for accepting it: real tag releases are rare, manual, and happen on a stable commit — transient flakiness is less likely to bite there than on the dev-prerelease path (which this workflow also handles). If the arm64 or other Tauri job proves unstable in practice, adding continue-on-error: true at the matrix level or splitting into per-group release steps is a straightforward follow-up. Leaving this note here so the trade-off is visible to reviewers.
|
Marking ready for review — this has been sitting as a draft but it's complete and CI-green. Additional verification this round (beyond the original PR-body testing):
What can't be CI-tested here (and is worth a careful read): the scheduled dev-release path ( Refs #1219 |
Summary
dev-release.yml,build.yml, andbuild-tauri.ymlworkflows with a singlerelease.ymlTesting
.github/workflows/release.ymlwithpython3+yaml.safe_loadgit diff --checkactivitywatch-...andactivitywatch-tauri-...names, so the combined release upload set is collision-safeRefs #1219