swc/.github/workflows/crate-version-management.yml

66 lines
1.5 KiB
YAML
Raw Normal View History

name: "Crate version management"
on:
workflow_dispatch:
inputs:
crate:
description: "Crate to bump version"
required: true
breaking:
description: "`1` if this is a breaking change"
required: true
default: "0"
jobs:
bump:
name: Bump version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-bump-version
- name: Install cargo mono
run: |
cargo install cargo-mono --vers 0.2.4
- name: Bump version
run: |
if [ "${{ github.event.inputs.breaking }}" == "1" ]; then
cargo mono bump ${{ github.event.inputs.crate }}"
else
cargo mono bump ${{ github.event.inputs.crate }}"
fi
- name: Update lockfile
run: |
cargo metadata
- name: Configure git
run: |
git config --local user.email "bot@swc.rs"
git config --local user.name "swc[bot]"
- name: Add files
run: |
git add -A
- name: Commit files
run: |
git commit -m 'chore: Bump version'
- name: Push back
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}