Skip to content

Publish new version

Publish new version #9

Workflow file for this run

name: Publish new version
on:
workflow_dispatch:
inputs:
bump:
type: choice
options:
- patch
- minor
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cargo/
key: ${{ runner.os }}-cargo-bump
- run: cargo install --git https://github.com/watsom27/cargo-bump.git --branch workspaces
- run: cargo bump --package jgd ${{ inputs.bump }}
- uses: fregante/setup-git-user@v2
- run: git commit --all --message "v$(make version)"
- run: git tag "v$(make version)" --message ""
- run: git push --follow-tags
- run: cargo publish