Skip to content

Latest commit

 

History

History
81 lines (53 loc) · 2.55 KB

1.bump-version.md

File metadata and controls

81 lines (53 loc) · 2.55 KB

⬆️ Bump Version

Overview

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:

  1. Test: Runs tests before bumping the version.
  2. Bump Version: Increases the project version and commits the changes.

How It Works

The workflow is triggered manually via GitHub's workflow_dispatch event. Users must select the type of version bump before execution.

Workflow Configuration

Trigger

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

Jobs

1. Test (1.1. Test)

This job ensures the code is tested before making version changes.

  • Runs on: ubuntu-22.04
  • Permissions: contents: read
  • Steps:
    1. Checkout the repository
    2. Set up Python 3.9
    3. Install dependencies (from requirements/requirements.test.txt)
    4. Run tests using pytest via ./scripts/test.sh -l

2. Bump Version (1.2. Bump Version)

This job updates the project version after tests pass.

  • Runs on: ubuntu-22.04
  • Permissions: contents: write
  • Steps:
    1. Checkout the repository (with full history)
    2. Bump the version using ./scripts/bump-version.sh
    3. Commits and pushes changes using GitHub Actions bot

Usage

To manually trigger this workflow:

  1. Navigate to the repository on GitHub.
  2. Go to the Actions tab.
  3. Select "1. Bump Version" from the list.
  4. Click "Run workflow".
  5. Choose a version bump type (patch, minor, or major).
  6. Click "Run workflow" to start the process.

Environment Variables

The workflow uses the following environment variables:

  • GITHUB_TOKEN: GitHub-provided authentication token for making commits.

Scripts Used

  • test.sh: Runs the test suite.
  • bump-version.sh: Handles version incrementing.

Notes

  • 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.

Troubleshooting

  • 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.