Make release workflow re-runnable and clean up on failure#96
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gh release createwhen a release for the tag already exists, so re-running the publish job (e.g. after a transient OSGEO upload error) no longer aborts onrelease already exists.created=truestep 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.Test plan
created=true,qgis-plugin-ci releaseuploads the asset.gh release viewsucceeds, step logsalready exists, skipping creation, setscreated=false, and the run continues intoqgis-plugin-ci release.Releasestep on a freshly-created release → cleanup step fires and deletes the release; the tag remains.Releasestep on a pre-existing release (re-run path) → cleanup step is skipped (created=false); pre-existing release is preserved.