This GitHub Action automates the process of bumping the project version. It allows users to choose whether to increment the version as a patch, minor, or major release. This workflow consists of two main jobs:
- Test: Runs tests before bumping the version.
- Bump Version: Increases the project version and commits the changes.
The workflow is triggered manually via GitHub's workflow_dispatch
event. Users must select the type of version bump before execution.
The action is triggered manually by dispatching a workflow with an input parameter bump_type
, which can have one of the following values:
patch
minor
major
This job ensures the code is tested before making version changes.
- Runs on:
ubuntu-22.04
- Permissions:
contents: read
- Steps:
- Checkout the repository
- Set up Python 3.9
- Install dependencies (from
requirements/requirements.test.txt
) - Run tests using
pytest
via./scripts/test.sh -l
This job updates the project version after tests pass.
- Runs on:
ubuntu-22.04
- Permissions:
contents: write
- Steps:
- Checkout the repository (with full history)
- Bump the version using
./scripts/bump-version.sh
- Commits and pushes changes using GitHub Actions bot
To manually trigger this workflow:
- Navigate to the repository on GitHub.
- Go to the Actions tab.
- Select "1. Bump Version" from the list.
- Click "Run workflow".
- Choose a version bump type (
patch
,minor
, ormajor
). - Click "Run workflow" to start the process.
The workflow uses the following environment variables:
GITHUB_TOKEN
: GitHub-provided authentication token for making commits.
test.sh
: Runs the test suite.bump-version.sh
: Handles version incrementing.
- Ensure that
bump-version.sh
supports-b
,-c
, and-p
options. - The workflow ensures that version bumping occurs only if tests pass.
- The changes are committed and pushed automatically to the repository.
- If the workflow fails in the
test
step, check test logs for errors. - If version bumping fails, ensure
bump-version.sh
is executable and correctly configured. - If permissions errors occur, verify that GitHub Actions has the required
contents: write
permission.