Skip to content

Bump Version

Bump Version #8

Workflow file for this run

# .github/workflows/release.yml
name: Bump version
on:
workflow_dispatch:
inputs:
bump:
description: 'Increment manifest version'
required: true
type: choice
options: [major, minor, patch, rc, beta, alpha]
default: 'minor'
jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Install just
uses: extractions/setup-just@v2
- name: Install cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Install cargo-edit
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-edit
- name: Install patch-crate
uses: baptiste0928/cargo-install@v3
with:
crate: patch-crate
- name: Bump version ${{ github.event.inputs.bump }}
run: |
just bump ${{ github.event.inputs.bump }}
echo "version=$(just version)" >> "$GITHUB_ENV"
- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "🔖 Bump version number to $version"
git tag -a $version -m ""
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: Create release
uses: softprops/action-gh-release@v2.0.5
with:
draft: false
tag_name: ${{ env.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}