Skip to content

Commit f833ab5

Browse files
N3xedivmarkov
authored andcommitted
Tag the new release on Publish action (#24)
1 parent dc1e0e4 commit f833ab5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
env:
77
rust_toolchain: nightly-2022-04-07
8+
crate_name: embedded-svc
89

910
jobs:
1011
publish:
@@ -25,3 +26,13 @@ jobs:
2526
run: cargo login ${{ secrets.crates_io_token }}
2627
- name: Build | Publish
2728
run: cargo publish --target riscv32imc-esp-espidf -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
29+
- name: Get the crate version from cargo
30+
run: |
31+
version=$(cargo metadata --format-version=1 --no-deps | jq -r ".packages[] | select(.name == \"${{env.crate_name}}\") | .version")
32+
echo "crate_version=$version" >> $GITHUB_ENV
33+
echo "${{env.crate_name}} version: $version"
34+
- name: Tag the new release
35+
uses: rickstaa/action-create-tag@v1
36+
with:
37+
tag: v${{env.crate_version}}
38+
message: "Release v${{env.crate_version}}"

0 commit comments

Comments
 (0)