-
-
Notifications
You must be signed in to change notification settings - Fork 6
38 lines (32 loc) · 902 Bytes
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Publish New Version
on:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Ensures history is available for tags
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Bump version and create tag
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
cargo install cargo-bump
VERSION=$(cargo bump patch)
git commit -am "Bump version to $VERSION"
git tag $VERSION
git push && git push --tags
git branch $VERSION
- name: Publish to crates.io
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATES_IO_TOKEN }}