Skip to content

Bump Version

Bump Version #1

Workflow file for this run

name: Bump Version, Tag, Release, and Publish
on:
workflow_dispatch:
inputs:
version_type:
description: "Version increment type (patch, minor, major)"
required: true
default: patch
type: choice
options:
- patch
- minor
- major
jobs:
test:
uses: ./.github/workflows/test.yml
with:
python-version: "3.12"
bump_version:
runs-on: ubuntu-latest
needs: [test]
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
# Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
# Install dependencies
- name: Install dependencies
run: |
pip install bumpversion setuptools wheel build
# Run bumpversion
- name: Bump version
run: |
bumpversion --allow-dirty ${{ github.event.inputs.version_type }}
NEW_VERSION=$(cat .bumpversion.cfg | grep current_version | cut -d'=' -f2 | tr -d ' ')
echo "New version is $NEW_VERSION"
env:
GIT_AUTHOR_NAME: "github-actions[bot]"
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com"
# Push changes and tag
- name: Push changes and tag
run: |
git push origin HEAD
git push origin --tags
# Create GitHub release
- name: Create release
uses: actions/create-release@v1
with:
tag_name: v${{ steps.bump_version.outputs.NEW_VERSION }}
release_name: v${{ steps.bump_version.outputs.NEW_VERSION }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref_name }} # The name of the tag
release_name: Release ${{ github.ref_name }} # The name of the release
body: |
Automatically generated release for version ${{ github.ref_name }}.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
uses: ./.github/workflows/publish.yml

Check failure on line 89 in .github/workflows/bumpversion.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/bumpversion.yml

Invalid workflow file

error parsing called workflow ".github/workflows/bumpversion.yml" -> "./.github/workflows/publish.yml" (source branch with sha:03cab52b2323740e08f5512cc54c0f42f105a848) : workflow is not reusable as it is missing a `on.workflow_call` trigger
with:
python-version: "3.12"