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

Automate release process #325

Merged
merged 84 commits into from Mar 15, 2024
Merged

Conversation

ekcorso
Copy link
Contributor

@ekcorso ekcorso commented Mar 15, 2024

This automates the process for releasing a new version of tldextract. It prompts the user to add a tag, creates a build, prompts for verification, uploads the build to PyPi, pushes the new tag to Github, and then creates a draft of the Github release.

Note that the release notes will be based based on a combination of the CHANGELOG.md entry that matches the version tag and GitHub's generated changelog URL.

The user will need a Github app auth token and Pypi credentials in order to run this.

Changes

  • Add script to interactively release the current work tree, tagged, to PyPI and GitHub
  • Add release-only dependencies
  • Typecheck scripts folder
    • The folder is not a package, so tell mypy --explicit-package-bases
  • Test script happy path
    • Add snapshot library dependency
      • To unit test network and subprocess input, and verbose CLI output
    • Skip test on Windows
      • Snapshot paths are platform-dependent. Maintainers don't yet release using Windows, besides.

@john-kurkowski
Copy link
Owner

For PyPI releases of this project, I told @ekcorso I was trying to remember and manually execute several steps. We collaborated on this script offline. Now my manual steps are codified in this repo! Hopefully less error prone for me, and the steps could be followed by any maintainer. I'm excited to put this to use. Thank you!

Prerequisites:
- This must be run from the root of the repository.
- The repo must have a clean git working tree.
- The user must have the GITHUB_TOKEN environment variable set to a valid GitHub personal access token.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a bullet for PyPI credentials? During the script, users will need to paste in a token from their password manager?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Done!

@john-kurkowski john-kurkowski merged commit a2eb188 into john-kurkowski:master Mar 15, 2024
27 checks passed
@john-kurkowski
Copy link
Owner

I used the script to release 5.1.2. Script worked like a charm! 🙌

Only a couple minor follow-ups:

  1. I fat-fingered something later in the process and couldn't re-run the script as is, I had to manually delete a tag, outside the script. Automated tag rollback in befc91c.
  2. I had to manually restore the release's "New Contributors" section automatically generated by GitHub. This script was stripping too much from the automatic release notes. Fixed in Keep more of GitHub release notes body #327.

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

Successfully merging this pull request may close these issues.

None yet

2 participants