Use workspace keys in Cargo.toml

This commit is contained in:
2024-09-10 23:19:19 -06:00
parent d2b8135cdb
commit 6f3052e05d
6 changed files with 41 additions and 29 deletions

View File

@@ -11,6 +11,7 @@ on:
env:
BUILD_PROFILE: release-lto
CARGO_TARGET_DIR: target
CARGO_INCREMENTAL: 0
jobs:
check:
@@ -18,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [ stable, 1.73.0, nightly ]
toolchain: [ stable, 1.74.0, nightly ]
fail-fast: false
env:
RUSTFLAGS: -D warnings
@@ -179,14 +180,12 @@ jobs:
set -eou pipefail
tag='${{github.ref}}'
tag="${tag#refs/tags/}"
for file in */Cargo.toml; do
version=$(grep '^version' $file | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
version="v$version"
if [ "$tag" != "$version" ]; then
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
exit 1
fi
done
version=$(grep '^version' Cargo.toml | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
version="v$version"
if [ "$tag" != "$version" ]; then
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
exit 1
fi
- name: Download artifacts
uses: actions/download-artifact@v4
with:
@@ -217,3 +216,5 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: out/*
draft: true
generate_release_notes: true