Skip to content

Commit 30094f6

Browse files
authored
ci: add publish action (#301)
1 parent 4845988 commit 30094f6

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dry-run:
7+
description: 'Dry run (do not publish to crates.io)'
8+
required: true
9+
default: 'true'
10+
level:
11+
description: 'Release level'
12+
required: true
13+
default: 'patch'
14+
type: choice
15+
options:
16+
- patch
17+
- minor
18+
- major
19+
20+
env:
21+
CARGO_TERM_COLOR: always
22+
RUSTFLAGS: -Dwarnings
23+
RUSTDOCFLAGS: -Dwarnings
24+
RUST_BACKTRACE: 1
25+
26+
jobs:
27+
release:
28+
runs-on: ubuntu-latest
29+
permissions: write-all
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- run: rustup show active-toolchain -v
36+
37+
- name: Install cargo-release
38+
run: cargo install cargo-release
39+
40+
- name: Release
41+
run: |
42+
cargo release ${{ github.event.inputs.level }} ${{
43+
if eq(github.event.inputs.dry-run, 'false')
44+
then '--execute'
45+
else ''
46+
end
47+
}}

0 commit comments

Comments
 (0)