-
Notifications
You must be signed in to change notification settings - Fork 9
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
Clean up failed releases #546
Conversation
name: Clean up Failed Releases | ||
if: ${{ failure() }} | ||
runs-on: ubuntu-latest | ||
needs: [upload_release_binaries, get_version] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs: [upload_release_binaries, get_version] | |
needs: [upload_release_binaries] |
Is there any reason not to just do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I guess that gives us needs.get_version.outputs.ARK_VERSION
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
.github/workflows/release.yml
Outdated
- name: Delete failed release if any | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
TAG=${{ needs.get_version.outputs.ARK_VERSION }} | ||
if gh release view $TAG > /dev/null 2>&1; then | ||
echo "Cleaning up release $TAG" | ||
gh release delete $TAG -y --cleanup-tag | ||
else | ||
echo "No release to clean up" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than gh release view
should we just use the same "release exists" action from above? (it needs to be updated too, but the consistency feels nice)
- name: Check for existing release tag
uses: mukunku/[email protected]
id: check_tag
with:
tag: ${{ needs.get_version.outputs.ARK_VERSION }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, and I've updated the action
8bffef9
to
7582bb5
Compare
7582bb5
to
0f56d85
Compare
It's currently possible for our workflows to leave a new release in a failed or incomplete state:
To avoid this, we now clean up releases in case of propagated failure.
Another change made here is that the Slack failure report will now also be sent if an upload-release step fails. Previously we would only report build failures.
Making sure we don't create partial releases should help with posit-dev/positron#4815.
Approach: This uses the
gh
CLI tool to check for existence of a release and delete it if any.