Skip to content

Release

Release #2

Workflow file for this run

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