-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Fix release workflows #395
Conversation
Nice!! |
Run on Wed May 1 19:59:27 UTC 2024 |
It works! Kind of.
But, the part of the process that autogenerates the changelog failed, because it can't push to the branch:
Since the To work around this in my other projects, I often rely on https://github.com/CasperWA/push-protected. It explains the token problem quite clearly:
So, in short, we'd need a PAT generated with the appropriate permissions, stored as a secret in this repo. Here are the permissions for the one I use: Let me know if this makes sense or if there's another alternative you'd like to see! |
The way I've handled it in a project is by using a release PR. You create a PR that bumps the version number. On merging with If that process were used, the jobs running on the branch could do the same version/title check, and push an update to the changelog, which would get merged before the release is cut. One possibility to keep from having to add a PAT. ADDED: granted, I did this with GitLab CI, so the job language is different - don't know if it's possible here. |
Ooh, that makes sense. I'll chew on that and work with it. Thanks for the suggestion! |
Thanks so much for your work here, @gjtorikian!! And likewise @digitalmoksha for chipping in with your experience. (I am of course happy to go either way — if you run out of steam looking into doing it with a release PR, Garen, it doesn't bother me to use a PAT like you do elsewhere.) |
Well, I usually copy paste this PAT technique across all my projects, but it is a significant annoyance: these PATs must have an expiry date, and so require attention and upkeep. I’d rather poke around on how I can get the PR process working since it involves even less human involvement! |
Don't know if it would be helpful or not, but here's the GitLab CI configuration we use for the GLFM gem, with the release trigger being in a shared component (or action)
The other nice little bit is the use of |
After much chagrin and gnashing of teeth, I ran into another problem with the automation: PRs that are opened by the GitHub Actions bot do not automatically run workflows. Therefore, they can't be automerged, because the required test suite never executes. A solution to this is to use a PAT with the permissions listed above, which is exactly what I am trying to avoid. With that in mind, here's the proposed release workflow:
At this point, one can push updates to the changelog if need be. But the admin needs to manually merge this release PR. When that occurs, the rest of the process kicks off: a git tag is created, a GitHub release is made, and the lib is pushed to crates.io. |
I'm more than moderately confident this will work, as the PR changelog is the only new piece that changed since the last run through. I'm happy with this PR being merged as is, or take any feedback! |
LGTM! Thank you so much! I've updated |
So with ya'lls permission, wanted to try to release a 0.24.0 (or 0.23.1) with the new wiki link support. I just want to clarify the first step, Bump version in Cargo.toml. So update Cargo.toml and commit it directly into Or run the release workflow, which creates the PR, then commit the version update on that branch? |
I think the latter should work just as well (and would therefore be preferable!). And it should be 0.24.0, since we've modified the API in a backwards incompatible way: anyone doing an exhaustive |
Just tried - at the moment it doesn't work, which makes sense - the PR title, changelog comparison, and the branch name are built using the new version number. See #414 So I will push the version to |
Of course |
#416 was created by release workflow. But I don't have permission to merge it without all checks passing. I removed the Going to hold off for the moment. |
Closed and re-opened the PR per the PR text; hopefully should do it. |
Yep, that's what happens when trying to do something when enough coffee hasn't been consumed - you gloss over clearly written text. 🤦 |
The bad news is I made a slight error in #374: I needed to provide a GitHub token to create a release.
The good news is that now that the workflow is in
main
, I can make any adjustments necessary here in the PR.I also noticed a bunch of warnings stemming from the (deprecated!) https://github.com/actions-rs/toolchain action:
I'm actually not sure why I included this step, because it's not at all necessary to have Rust installed for this process.