-
Notifications
You must be signed in to change notification settings - Fork 422
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
Refactor release process in order to include changelog in release files #1246
Conversation
I think this is an okay quick fix (potentially for the next release so we're not blocked by this?). What I don't like about this is that the release artifacts in github releases would not contain the updated changelog. Not a huge deal I guess, but feels wrong. |
I understand. What alternative do you suggest? My idea would be to transfer the release-related jobs from the I could rework the PR towards that, WDYT? |
Yes, that would be my suggestion as well. Should lead to the cleanest result overall. Just mentioning that @gaborbernat mentioned that this project tries to avoid this kind of workflow, but I don't see a good alternative. |
Where would you specify the version to release in a workflow_dispatch? |
Works for me 👍 remember to update https://github.com/pypa/pipx/blob/main/CONTRIBUTING.md#releasing-new-pipx-versions |
There is one complication which requires a bit more discussion. If we want to stick with opening a pull request every release to update the changelog, how can the same workflow be configured to create a GH release after that pull request is merged? |
I think release-please does it by giving the changelog PR a specific label and watching for that label for creating the release. |
Will you work on this soon @chrysle? If not I'd suggest we create a release soon with the current setup. There's a pretty good amount of bug fixes and new features to be released now. If we do one with the current setup, I can manually create a PR updating the docs, so they show up correctly in the docs after the release? |
Agreed. I just discovered that |
411ec66
to
3f62f1f
Compare
Updated. See the result in chrysle@fff3448. |
While your current solution works, what about giving this changelog PR a specific label and run the release via pipeline when a PR with that label is merged? Label is a direct part of the pull_request object when using the pull_request trigger, and the version to release we can extract from the PR title, which is also in the Removes one manual step from the pipeline. |
I'll look into it, it could take a little bit of time, though. |
stable
tags
This isn't quite that easy, as it turns out.. After trial and error for a while I finally managed to get my workflow to trigger on |
@henryiii May I ask for some advice? The current state is at https://github.com/chrysle/pipx/tree/test-cd. |
@henryiii Pinging you on this as requested. |
Just seeing this now. That sounds quite tricky indeed. As far as I'm concerned, unless someone that is really into github workflows wants to pick this up, I'm fine with having a 2 step release. Manually creating the release after merging the changelog changes is easy to document and not that difficult or prone to error. I'm sure your time is better spent somewhere else than this ;) Sorry I sent you on this goose hunt. |
IIUC, those release related jobs/steps should belong to a different workflow, which maybe name: Release
on:
pull_request:
types: [closed]
jobs:
create-release:
if: >-
github.event_name == 'pull_request'
&& github.event.pull_request.merged == true
&& github.event.pull_request.labels.name == 'release-version'
steps:
- ...
- ... |
Yup, you're seeing an outdated version here, actual work happened at https://github.com/chrysle/pipx/tree/test-cd. But your comment inspired me to attempt moving all the release-related jobs into this workflow, and I finally managed, although I went half crazy (this is the last time I've done anything with GH Actions here, rest assured). Here the successful run and the release it created. If you think that's all in order, I'll merge the development branch; otherwise, I'll give up. |
IMO, it looks pretty good. Previously, I just use a tag in semver to trigger the release process. This two steps release process is quite a good idea. I may also apply it in my personal projects. :-) |
Co-authored-by: Robert <[email protected]>
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.
Great stuff
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.
Just realize some concern about concurrency.
And fix concurrency group definition in `release.yml`.
Thanks for correcting my oversight! Updated. |
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.
Great job!
…es (pypa#1246) * Extract `bump-changelog` action into separate workflow * Create `create-release` job in `tests.yml` * Bump changelog for 1.0.0 (pypa#2) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Specify pull request types that trigger CI * Remove requirement for job * Try to fix label detection * Try out `pull_request_target` event * Fix environment variable access syntax * Try splitting out in separate workflow * Use concurrency * Create `create-release` job in `tests.yml` * Specify pull request types that trigger CI * Remove requirement for job * Try to fix label detection * Try out `pull_request_target` event * Fix environment variable access syntax * Try moving related jobs into release workflow * Specify Python version in release workflow * Amend for testing * Retrieve artifact from previous workflow run * Create release before uploading asset (makes sense) * Specify tag name * Don't run in parallel *yawn* * Get that blasted tag * Permissions * Cleanup, docs * Extract `bump-changelog` action into separate workflow * Create `create-release` job in `tests.yml` * Bump changelog for 1.0.0 (pypa#2) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Specify pull request types that trigger CI * Remove requirement for job * Try to fix label detection * Try out `pull_request_target` event * Fix environment variable access syntax * Try splitting out in separate workflow * Use concurrency * Create `create-release` job in `tests.yml` * Specify pull request types that trigger CI * Remove requirement for job * Try to fix label detection * Try out `pull_request_target` event * Fix environment variable access syntax * Try moving related jobs into release workflow * Specify Python version in release workflow * Amend for testing * Retrieve artifact from previous workflow run * Create release before uploading asset (makes sense) * Specify tag name * Don't run in parallel *yawn* * Get that blasted tag * Permissions * Cleanup, docs * Better sentence structure Co-authored-by: Robert <[email protected]> * Use concurrency in `bump-changelog.yml` And fix concurrency group definition in `release.yml`. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Robert <[email protected]>
changelog.d/
(if the patch affects the end users)Summary of changes
This ought to correctly include the changelog in the docs on release, after PR merge.
Test plan
Tested by running