Release #5
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" | |
# First create a PR for the new version before pushing the artifacts. If this fails, we can just rerun the job since there are no artifacts uploaded yet. | |
- name: commit the new pyproject.toml with the new version | |
uses: EndBug/add-and-commit@v9 # You can change this to use a specific version. | |
with: | |
message: "chore(ci): bumped the version to ${{ steps.bump_version.outputs.VERSION }}" | |
new_branch: "chore/version-bump" | |
default_author: github_actions | |
# - name: create pull request | |
# run: gh pr create -B main -H branch_to_merge --title '(ci)' --body 'Created by Github action' | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Build and publish | |
# run: | | |
# poetry install --no-dev | |
# poetry build | |
# # poetry publish | |