Release #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
bump: | |
type: choice | |
description: How to bump the version | |
required: true | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.BOT_ACCESS_TOKEN }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- run: python -m pip install poetry | |
- run: poetry install --all-extras | |
- name: Configure git | |
run: | | |
git config --global user.name 'Release bot' | |
git config --global user.email '[email protected]' | |
git push | |
- name: bump release version and tag | |
run: | | |
poetry version ${{ github.event.inputs.bump }} | |
export NEW_VERSION=v$(poetry version -s) | |
git commit -am "Bumping to version $NEW_VERSION" | |
git tag -a $NEW_VERSION -m $NEW_VERSION | |
- name: prepatch to the next version | |
run: | | |
poetry version prepatch | |
export NEW_VERSION=v$(poetry version -s) | |
git commit -am "Prepatching to $NEW_VERSION" | |
- name: Push results | |
# See https://www.wearecogworks.com/blog/quick-guide-to-running-sub-workflows-with-github-actions/ | |
run: | | |
git push "https://$GITHUB_ACTOR:${{ secrets.BOT_ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" | |
git push "https://$GITHUB_ACTOR:${{ secrets.BOT_ACCESS_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" --tags |