Skip to content
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

Improve release process #66

Open
pcolmer opened this issue Jul 29, 2022 · 3 comments
Open

Improve release process #66

pcolmer opened this issue Jul 29, 2022 · 3 comments

Comments

@pcolmer
Copy link
Contributor

pcolmer commented Jul 29, 2022

See #58 (comment)

@pcolmer
Copy link
Contributor Author

pcolmer commented Jul 29, 2022

@nitrocode I thought it was worth putting together an issue on the work required to improve how aws2-wrap is "released". I've been reading - and trying to understand (!) - the workflows for policy_sentry.

Looking at publish.yml specifically, my main confusion at the moment is that the sequence in the workflow seems to be that a package gets published to PyPi via publish_package ... but bump-version gets executed after that, suggesting that the version of the package doesn't get updated from the GitHub tag until after the package has been published.

Am I misunderstanding that workflow or is there some secret sauce I'm not taking into account?

@nitrocode
Copy link
Contributor

I didn't know any of this until I read the workflows and logs. I believe the process in policy_sentry uses this process.

  1. At some point, the current release tag and pypi version is 0.12.3 but the default branch contains the version tag of a future release i.e. in versions.py of 0.12.4 (from when release published was 0.12.3)
  2. Previous release is published 0.12.3
  3. Release drafter runs to create a new draft release with the appropriate semver release tag 0.12.4 (matching the versions.py)
  4. Some PRs will merge
  5. The owner/maintainer publishes the draft release as 0.12.4 which kicks off the publish workflow which kicks off the publish-package job like you mentioned.
  6. publish-package runs first to publish 0.12.4 to pypi, then bump-brew to update the in-repo homebrew formula to 0.12.4 (we can skip this), then bump-version to bump the versions.py to 0.12.5

If we take a look at tag 0.12.4's version.py, it contains 0.12.4 as expected.

https://github.com/salesforce/policy_sentry/blob/0.12.4/policy_sentry/bin/version.py

And the current default branch version.py is 0.12.5 (next release).

https://github.com/salesforce/policy_sentry/blob/597b3ee453082a8b5b8bff63045b49c8f1f9d625/policy_sentry/bin/version.py#L2

Here's the full workflow

https://github.com/salesforce/policy_sentry/actions/runs/2701009990

Here is the 0.12.4's bump-version log

https://github.com/salesforce/policy_sentry/runs/7419144708?check_suite_focus=true

Already up to date.
latest tag: 0.12.4
new tag: 0.12.5
[master 597b3ee4] Bump to 0.12.5

I believe this was all setup by @kmcquade (if you have a sec, please let me know if I have any of the above is incorrect).

The above doesn't have to be modeled exactly. It could be a good starting point. :)

Also, we do not have to follow policy_sentry's update-brew workflow since the aws2-wrap formula is published to homebrew-core, we can instead use a workflow like this to send a PR to homebrew-core using mislav/bump-homebrew-formula-action

https://github.com/cloudposse/atmos/blob/f811a5d14225bbd668dd950da114258c258a608e/.github/workflows/build.yml#L38-L47

@pcolmer
Copy link
Contributor Author

pcolmer commented Aug 4, 2022

Thanks, @nitrocode. I'm a bit caught up with an internal project at the moment. When I get a chance, I'll have a go at incorporating these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants