-
Notifications
You must be signed in to change notification settings - Fork 359
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
build: INFENG-933: add GitHub action to start a minor release #10112
Conversation
Add GitHub action to start a minor release. This is necessary, temporarily, to run both lock-api-state.sh and lock-published-urls.sh, until we can figure out a way to make those same guarantees without committing directly to main every time we do a minor release. This basically just reproduces a small part of rph, but with GitHub actions instead.
Add steps to install Go and the buf/protobuf dependencies. Add some helpful newlines for readability.
output something helpful if an error occurs.
Add ::error:: to error output on version string validation step.
✅ Deploy Preview for determined-ui canceled.
|
grep -E -o '[0-9]+\.[0-9]+\.0' <(printf "%s" '${{ github.event.inputs.version }}') | ||
|
||
ret=$? | ||
if [[ $ret != 0 ]]; then | ||
echo '::error::Version string must match <[0-9]+\.[0-9]+\.0>. Got: <${{ github.event.inputs.version }}>' | ||
exit $ret | ||
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.
Since you're setting the shell to bash, you can technically just use bash pattern matching. Just think of the amazing speed improvement when you don't need a subshell and a fork!
grep -E -o '[0-9]+\.[0-9]+\.0' <(printf "%s" '${{ github.event.inputs.version }}') | |
ret=$? | |
if [[ $ret != 0 ]]; then | |
echo '::error::Version string must match <[0-9]+\.[0-9]+\.0>. Got: <${{ github.event.inputs.version }}>' | |
exit $ret | |
fi | |
shopt -s extglob | |
v='${{ github.event.inputs.version }}' | |
if [[ "$v" != @(+(0-0).+(0-9).0) ]]; then | |
echo '::error::Version string must match <[0-9]+\.[0-9]+\.0>. Got: <'"$v"'>' | |
exit 1 | |
fi |
Feel free to ignore this suggestion completely. People actually understand grep. :D
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.
Huh. Neat! I always learn something new about Bash from you.
Add GH_TOKEN env variable to use the DETERMINED_TOKEN secret, otherwise expect permissions issues when non-admins run the action. Add explicit contents: write permission.
Ticket
INFENG-933
Description
This changeset introduces a new GitHub action,
start-minor-release.yml
, which will, for the time being, be used to kick off minor releases. I'll explain why we need to do this, and then how.I wasn't quite able to eliminate all of the additional stateful commits that happen as part of the old release process in time for the upcoming release. What remains is two scripts that
rph
used to run:lock-api-state.sh
andlock-published-urls.sh
.lock-api-state.sh
generates a new buf image,proto/buf.image.bin
, which is used ahead of subsequent releases to check for breaking API changes. I was unable to replace that in a way that sufficiently reproduced this functionality (e.g. with pre-commit). I believelock-published-urls.sh
would be fine to run as part of every pre-commit check, or at least on every PR, but I also don't have time to test that out before the upcoming release, either.How this works is straightforward: the action validates the input version string, configures the git author information, sets up Go, installs buf/protobuf dependencies, creates a release branch with that version string, pushes it to
origin
, checks out main, runs the two scripts mentioned above, then pushesmain
back toorigin
. These lines in rph, basically, albeit without runningbumpversion
.Test Plan
GitHub actions are always tricky to test, especially this one, because it makes changes on main and creates a release branch. I did, however, test this out on the determined-dryrun repository, with the same GitHub action. You can see that the automation created a new release branch,
release-0.39.0
, and then made the two requisite commits on main forlock-api-state.sh
andlock-published-urls.sh
, complete with similar changes that will get made for the upcoming production release.Checklist
docs/release-notes/
See Release Note for details.