Skip to content

Commit

Permalink
ci: record version in context
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <[email protected]>
  • Loading branch information
rvolosatovs committed Sep 5, 2024
1 parent fde05d6 commit 3241f95
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/wrpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ jobs:
id: ctx
run: |
version=${GITHUB_REF_NAME#crates/${{ matrix.crate }}/v}
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "version is ${version}"
if [[ $version == *"-"* ]]; then
echo "version ${version} is a pre-release"
Expand All @@ -250,7 +251,7 @@ jobs:
continue-on-error: ${{ github.repository_owner != 'wrpc' }}
run: |
pkgver=$(cargo pkgid | cut -d '@' -f 2)
tagver=${{ steps.ctx.outputs.version }}
tagver="${{ steps.ctx.outputs.version }}"
if ! [ "$pkgver" = "$tagver" ]; then
echo "version mismatch, $pkgver (package) != $tagver (tag)"
exit 1
Expand Down Expand Up @@ -388,6 +389,7 @@ jobs:
id: ctx
run: |
version=${GITHUB_REF_NAME#v}
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "version is ${version}"
if [[ $version == *"-"* ]]; then
echo "version ${version} is a pre-release"
Expand All @@ -397,8 +399,9 @@ jobs:
- name: publish wRPC to crates.io
run: |
pkgver=$(cargo pkgid | cut -d '@' -f 2)
if ![ "$pkgver" = "${{ steps.ctx.outputs.version }}" ]; then
echo "version mismatch, $pkgver (package) != ${{ steps.ctx.outputs.version }} (tag)"
tagver="${{ steps.ctx.outputs.version }}"
if ![ "$pkgver" = "$tagver" ]; then
echo "version mismatch, $pkgver (package) != $tagver (tag)"
exit 1
fi
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand Down

0 comments on commit 3241f95

Please sign in to comment.