-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add workflow for floating the v1
tag to the latest release
#361
Merged
jeffwidman
merged 1 commit into
main
from
add-workflow-for-floating-v1-tag-to-latest-release
May 19, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Release - Move Tracking Tag | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
Move-Tracking-Tag-To-Latest-Release: | ||
runs-on: ubuntu-latest | ||
|
||
# We have a choice - defensiveness vs convenience: | ||
# 1. Be defensive by filtering if the release doesn't look like a normal | ||
# version, or if it's a patch release to an older version... the logic | ||
# gets tricky quickly. Easiest way to be 100% sure is stop running this | ||
# on `release` and instead require a human to manually run this workflow | ||
# after they tag a release. | ||
# 2. Minimize the upfront hassle by assuming every release is a normal | ||
# version release and the latest one. Today both are resoundingly true | ||
# as this repo isn't that active/busy, so we don't worry about | ||
# multiple release branches, pre-releases, etc. | ||
# | ||
# For now I've gone with option 2, as it is much more convenient and if we | ||
# typo something during a release it's easy to fix by immediately tagging a | ||
# correct release. And if we don't notice the typo, well, in that case | ||
# requiring a human to manually run the workflow wouldn't have protected us | ||
# either, we'd have had to filter by only things that look like versions. | ||
# Anyway, for now this is good enough, and if it gets to be a problem down | ||
# the road we increase the robustness of this. | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.DEPENDABOT_AUTOMATION_PAT }} | ||
|
||
- name: Move the tracking tag | ||
run: git tag -f v1 | ||
|
||
- name: Push the new tag value back to the repo | ||
run: git push -f origin refs/tags/v1 | ||
|
||
- name: Set summary | ||
run: | | ||
echo ":rocket: Successfully moved the \`v1\` tag to point at release: ${{ github.event.release.name }} with SHA: \`$GITHUB_SHA\`." >> $GITHUB_STEP_SUMMARY |
This file contains 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
Oops, something went wrong.
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.
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.
I could use feedback here... do we go for convenience and bump tag on every release, or safety and require manually triggering this workflow after a release is tagged?
I've opted for simplicity for now given how infrequently we release in this repo, we are unlikely to backport fixes to a prior release, and today's problem is we're not releasing this often enough because of inconvenience... and we can always tighten this down in the future if needed.
But open to feedback if others feel strongly we should have this
on: workflow_dispatch
...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.
Every release seems fine for this project