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: | |
version_rule: | |
description: 'Version to bump (major, minor, patch)' | |
required: true | |
type: choice | |
options: | |
- "major" | |
- "minor" | |
- "patch" | |
default: "minor" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
pip install poetry | |
- name: Update the version | |
id: bump_version | |
run: | | |
poetry version ${{ github.event.inputs.version_rule }} | |
echo VERSION=$(poetry version -s) >> "$GITHUB_OUTPUT" | |
- name: Build and publish | |
run: | | |
poetry install --no-dev | |
poetry build | |
# poetry publish | |
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version. | |
with: | |
message: "Bump version to ${{ steps.bump_version.outputs.VERSION }}" | |
add: "pyproject.toml" | |
default_author: github_actions |