Skip to content

rehborn/uv-version-bump-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

uv version bump action

unofficial action to update your version using astral-sh/uv and create git tag according to PEP440

  • bump version with uv (update pyproject.toml+uv.lock) and push to origin
  • create a git tag for new version and push to remote
  • return VERSION for further usage

inputs

argument default description
bump minor Version Bump (major, minor, patch + alpha, beta, rc, post, and dev, ie "minor dev")
github_token ${{ github.token }} GITHUB_TOKEN for updating pyproject.toml and uv.lock and pushing version as tag
commit_message bump to version git commit message
tag_message version git tag message
tag_prefix empty prefix for git tag

minimal example

  - name: Version Bump
    uses: rehborn/[email protected]
    with:
      bump: "major dev"
      github_token: ${{ secrets.GITHUB_TOKEN }}

full example

  - name: Version Bump
    uses: rehborn/[email protected]
    with:
      bump: "major dev"
      github_token: ${{ secrets.GITHUB_TOKEN }}
      commit_message: 'Bump Release Version'
      tag_message: 'Release'

complete workflow example

name: Bump Version

on:
  workflow_dispatch:
    inputs:
      bump:
        required: false
        description: Version Bump (major, minor, patch + alpha, beta, rc, post, and dev)
        type: string
        default: 'patch'

jobs:
  bump:
    name: Version Bump
    runs-on: ubuntu-latest
    permissions:
      contents: write

    # store for use with reusable actions
    outputs:
      VERSION: "${{ steps.version.outputs.VERSION }}"

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          persist-credentials: false

      - name: Version Bump
        id: version
        uses: rehborn/[email protected]
        with:
          bump: ${{ inputs.bump }}
          github_token: ${{ secrets.GITHUB_TOKEN }}

  # Access VERSION in job
  output:
    needs: bump
    runs-on: ubuntu-latest
    name: test output
    steps:
      - name: test
        run: echo ${{ needs.bump.outputs.VERSION }}

  # Pass VERSION to Jobs
  build:
    needs: bump
    permissions:
      packages: write
      contents: write
      id-token: write
    uses: ./.github/workflows/build.yml
    secrets: inherit
    with:
      version: ${{ needs.bump.outputs.VERSION }}

  release:
    needs:
      - bump
      - build
    permissions:
      packages: write
      contents: write
    uses: ./.github/workflows/release.yml
    secrets: inherit
    with:
      version: ${{ needs.bump.outputs.VERSION }}

About

bump version with uv (update pyproject.toml+uv.lock) and create a git tag for version

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •