Bump Version on Tag #6
This file contains hidden or 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: "Bump Version on Tag" | |
on: | |
push: | |
tags: | |
- "v*.*" | |
workflow_dispatch: | |
jobs: | |
bump-version: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
- uses: cachix/install-nix-action@v31 | |
- uses: cachix/cachix-action@v16 | |
with: | |
name: devenv | |
- name: Install devenv.sh | |
run: nix profile install nixpkgs#devenv | |
- name: Bump version | |
run: devenv shell -- cargo set-version -p devenv --bump patch | |
- name: Get new version | |
id: get-version | |
run: echo "VERSION=$(nix eval --raw --expr '(builtins.fromTOML (builtins.readFile ./Cargo.toml)).workspace.package.version' --impure)" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v6 | |
with: | |
commit_message: "Next release is ${{ steps.get-version.outputs.VERSION }}" | |
file_pattern: "Cargo.toml Cargo.lock" |