chore: Setup workfllow to bump version (#2368)

This commit is contained in:
Donny/강동윤 2021-10-07 16:07:55 +09:00 committed by GitHub
parent 1e9ecfbad1
commit e2a0edd49d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 80 additions and 3 deletions

66
.github/workflows/bump-version.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Managment
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
continue-on-error: true
run: |
cargo install cargo-mono
- 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 'Bump version'
- name: Push back
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

View File

@ -1,16 +1,27 @@
on: workflow_dispatch
name: Publish crates
name: Managment
jobs:
publish-all:
name: Publish
publish-crates:
name: Publish crates
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-publish-crates
- name: Install cargo-mono
continue-on-error: true
run: |
cargo install cargo-mono