-
-
Notifications
You must be signed in to change notification settings - Fork 284
fix: update release tags with corrected flake hash #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: update release tags with corrected flake hash #277
Conversation
Previously, when a release was published, the update-flake-hash workflow would calculate the correct hash and update the main branch, but the release tag would still point to a commit with the old/incorrect hash. This caused hash mismatch errors when users tried to run: nix run github:TibixDev/winboat/v0.8.7 The workflow now force-updates the release tag to point to the commit with the corrected hash, ensuring consistency between tags and the actual release artifacts. Fixes TibixDev#164
Note: This PR also relates to #177, which reports that the While this PR fixes the tag update logic (ensuring tags point to commits with correct hashes), there may be a separate issue with the workflow trigger itself. If the workflow isn't running at all, then this fix won't help until that's resolved. The workflow trigger is currently: on:
release:
types: [published] If the workflow isn't triggering, we may also need to investigate:
Both issues should be addressed for a complete fix. |
The workflow was not triggering on release events because releases created by GITHUB_TOKEN don't trigger other workflows. This is a known GitHub Actions limitation to prevent infinite loops. Changes: - Replace 'release: published' trigger with 'workflow_run' that triggers after the 'Build WinBoat' workflow completes - Only run on successful workflows triggered by tags - Extract version from workflow_run.head_branch instead of release event - Add retry loop with curl to verify release asset availability before attempting to fetch (replaces sleep with proper polling) - Keep workflow_dispatch for manual triggering This ensures the workflow runs automatically after each release and can update both the flake.nix on main and force-update the release tag. Fixes TibixDev#164 Fixes TibixDev#177
Update: Now also fixes #177I've updated this PR to comprehensively address both issues: Root Cause AnalysisThe workflow wasn't triggering automatically because:
Complete SolutionChanged trigger mechanism:
Improved reliability:
Tag update (original fix):
TestingAll workflow logic has been validated:
ImpactThis fix ensures:
|
Looks good to me |
Problem
Users experience hash mismatch errors when trying to run WinBoat from release tags:
Error:
Root Cause
The
update-flake-hash
workflow has a timing issue:flake.nix
When users reference a tag (e.g.,
v0.8.7
), Nix uses theflake.nix
from that tag, which has the incorrect hash.Evidence
v0.8.7
(commita641ec8
) has hash:1s8nwxylp693yj2vzyqw68livy36j7rldiizf9p82hjw8xgsid13
(wrong - this is for v0.8.6)0wnbdnm1w59xyhw55bqac0jak16nvcs91qixnxyrnq2b46gpvmg0
(correct for v0.8.7)Solution
This PR modifies
.github/workflows/update-flake-hash.yml
to force-update the release tag after calculating and committing the correct hash. This ensures the tag points to a commit with the accurate hash matching the release artifacts.Changes
flake.nix
Testing
Locally tested:
Impact
nix run github:TibixDev/winboat/vX.Y.Z
Fixes #164