-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (43 loc) · 1.23 KB
/
tag-and-publish-crate.yaml
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
39
40
41
42
43
44
45
name: tag and publish crate [manual]
on:
workflow_dispatch:
inputs:
tag-increment:
default: patch
required: true
type: choice
options:
- patch
- minor
- major
jobs:
publish:
runs-on: macos-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: install rustfmt
run: rustup component add rustfmt
- name: rustfmt check
run: cargo fmt --all -- --check
- name: install clippy
run: rustup component add clippy
- name: cargo clippy
run: cargo clippy --all-features --all-targets
- name: install cargo bump
run: cargo install cargo-bump
- name: bump version
run: cargo bump -g ${{ inputs.tag-increment }}
- name: push
run: git push && git push --tags
- name: cargo publish
run: cargo publish --token ${{ secrets.CRATES_TOKEN }}