Skip to content

Commit 5918a58

Browse files
authored
automate crate release on release drafter (#176)
1 parent a5f361c commit 5918a58

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
release:
3+
types: [published]
4+
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions-rs/toolchain@v1
12+
with:
13+
toolchain: stable
14+
override: true
15+
16+
- name: get version from tag
17+
id: get_version
18+
run: |
19+
realversion="${GITHUB_REF/refs\/tags\//}"
20+
realversion="${realversion//v/}"
21+
echo "::set-output name=VERSION::$realversion"
22+
23+
- name: Set the version for publishing
24+
uses: ciiiii/[email protected]
25+
with:
26+
file: "Cargo.toml"
27+
key: "package.version"
28+
value: "${{ steps.get_version.outputs.VERSION }}"
29+
30+
- uses: katyo/publish-crates@v1
31+
with:
32+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)