Workflows to automatically release Semantically Versioned Code
You will need the following tools to use the resources in this repo:
- Git-Cliff: A CLI that automatically generates change-logs from your commit history.
- GitHub Actions: A CI pipeline written in .yaml that triggers upon GitHub events.
- Git-commit (optional): A terminal plugin that makes writing conventional commits a breeze.
- Poetry (optional): A better Python package manager than Conda.
The file .github/workflows/release.yml
contains a GitHub workflow that will do the following:
- Update a CHANGELOG.md file in your repository.
- Update any references to the Version number in your repo.
- Commit and push these changes.
- Upload a new GitHub Release and git tag.
You must have a main
branch where your latest release is deployed. Your main
branch must also have access to the latest git tag because that is how git-cliff
calculates its version bump.
To set secrets.GH_TOKEN
:
- Go to your GitHub profile's developer settings and generate a new personal access token with codebase access.
- Go to your repo's settings and add a secret and set the value as the token.
If you prefer not to use the workflow, I have provided the script bump_version.sh
that can be ran manually or added to a pre-commit
pipeline.
If your repository has branch permissions set to not allow direct pushes to main
, you might have to use an admin or machine user's credentials. If that is not possible, another solution is to create a GitHub Application, which is out-of-scope for this project. Instead,