Skip to content

Commit f631fe7

Browse files
committed
ci: add publish script
1 parent c19baaf commit f631fe7

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish Crate
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- Cargo.toml
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
publish:
16+
name: Publish
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install Rust Toolchain
22+
uses: ./.github/actions/rustup
23+
with:
24+
save-cache: false
25+
26+
- name: Cargo check
27+
run: cargo check --locked
28+
29+
- uses: katyo/publish-crates@v2
30+
id: publish-crates
31+
with:
32+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
ignore-unpublished-changes: true
34+
35+
- name: Create GitHub Release
36+
if: fromJSON(steps.publish-crates.outputs.published).*
37+
uses: softprops/action-gh-release@v1
38+
with:
39+
name: v${{ fromJSON(steps.publish-crates.outputs.published).version }}
40+
draft: true
41+
fail_on_unmatched_files: true
42+
generate_release_notes: true

0 commit comments

Comments
 (0)