Skip to content

Make release workflow re-runnable and clean up on failure#96

Merged
elfpkck merged 1 commit into
mainfrom
harden-release-workflow
Jun 1, 2026
Merged

Make release workflow re-runnable and clean up on failure#96
elfpkck merged 1 commit into
mainfrom
harden-release-workflow

Conversation

@elfpkck

@elfpkck elfpkck commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Skip gh release create when a release for the tag already exists, so re-running the publish job (e.g. after a transient OSGEO upload error) no longer aborts on release already exists.
  • Track whether this run created the release via a created=true step output, and on job failure delete the release only when we created it — preventing partial publishes from leaving an empty GitHub Release with no plugin zip attached.
  • The tag is preserved on cleanup so a re-run proceeds normally.

Test plan

  • Trigger the workflow against a tag where the release does not yet exist → step creates the release, sets created=true, qgis-plugin-ci release uploads the asset.
  • Re-run the publish job for an already-released tag → gh release view succeeds, step logs already exists, skipping creation, sets created=false, and the run continues into qgis-plugin-ci release.
  • Simulate a failure in the Release step on a freshly-created release → cleanup step fires and deletes the release; the tag remains.
  • Simulate a failure in the Release step on a pre-existing release (re-run path) → cleanup step is skipped (created=false); pre-existing release is preserved.

Skip `gh release create` when the release already exists so re-running
the publish job after a transient `qgis-plugin-ci` failure (e.g. OSGEO
upload error) no longer aborts on "release already exists". Track
whether this run created the release, and on failure delete it — but
only if we created it this run — so a partial publish doesn't leave an
empty release with no plugin zip attached. The tag is preserved so a
re-run can proceed normally.
@codecov

codecov Bot commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@b913cf4). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #96   +/-   ##
=======================================
  Coverage        ?   93.67%           
=======================================
  Files           ?        9           
  Lines           ?      253           
  Branches        ?       23           
=======================================
  Hits            ?      237           
  Misses          ?        8           
  Partials        ?        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@elfpkck elfpkck self-assigned this Jun 1, 2026
@elfpkck elfpkck added the ci label Jun 1, 2026
@elfpkck elfpkck merged commit 3f6d284 into main Jun 1, 2026
7 checks passed
@elfpkck elfpkck deleted the harden-release-workflow branch June 1, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant