2021-10-30 09:47:14 +03:00
|
|
|
name: "Crate version management"
|
2021-10-07 10:07:55 +03:00
|
|
|
|
|
|
|
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
|
2021-10-30 12:29:33 +03:00
|
|
|
permissions:
|
|
|
|
issues: write
|
2021-10-07 10:07:55 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-10-30 10:23:30 +03:00
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v2
|
2021-10-07 10:07:55 +03:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/bin/
|
|
|
|
~/.cargo/registry/index/
|
|
|
|
~/.cargo/registry/cache/
|
|
|
|
~/.cargo/git/db/
|
|
|
|
target/
|
|
|
|
key: cargo-bump-version
|
|
|
|
|
2021-10-30 09:47:14 +03:00
|
|
|
- name: Install cargo mono
|
2021-10-07 10:07:55 +03:00
|
|
|
run: |
|
2021-10-30 09:47:14 +03:00
|
|
|
cargo install cargo-mono --vers 0.2.4
|
2021-10-07 10:07:55 +03:00
|
|
|
|
|
|
|
- name: Bump version
|
|
|
|
run: |
|
|
|
|
if [ "${{ github.event.inputs.breaking }}" == "1" ]; then
|
2021-10-30 10:23:30 +03:00
|
|
|
cargo mono bump ${{ github.event.inputs.crate }} --breaking
|
2021-10-07 10:07:55 +03:00
|
|
|
else
|
2021-10-30 10:23:30 +03:00
|
|
|
cargo mono bump ${{ github.event.inputs.crate }}
|
2021-10-07 10:07:55 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Update lockfile
|
|
|
|
run: |
|
|
|
|
cargo metadata
|
|
|
|
|
|
|
|
- name: Configure git
|
|
|
|
run: |
|
2021-10-30 12:29:33 +03:00
|
|
|
git config --global user.email "kdy1@users.noreply.github.com"
|
|
|
|
git config --global user.name "swc[bot]"
|
2021-10-07 10:07:55 +03:00
|
|
|
|
|
|
|
- name: Add files
|
|
|
|
run: |
|
|
|
|
git add -A
|
|
|
|
|
|
|
|
- name: Commit files
|
|
|
|
run: |
|
2021-10-30 09:47:14 +03:00
|
|
|
git commit -m 'chore: Bump version'
|
2021-10-07 10:07:55 +03:00
|
|
|
|
2021-10-30 12:29:33 +03:00
|
|
|
- name: Push
|
|
|
|
run: |
|
|
|
|
git push
|