Skip to content

Commit 526d237

Browse files
committed
fix: release workflow
1 parent ec870f3 commit 526d237

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,9 @@ jobs:
2828
# Also create version without 'v' prefix for cargo
2929
VERSION_NUMBER="${VERSION#v}"
3030
echo "version_number=$VERSION_NUMBER" >> $GITHUB_OUTPUT
31-
# Extract crate version
32-
CRATE_VERSION=$(grep "^version" Cargo.toml | head -1 | cut -d'"' -f2)
33-
echo "crate_version=$CRATE_VERSION" >> $GITHUB_ENV
3431
echo "Using ref: $REF"
3532
echo "Using version: $VERSION"
3633
echo "Using version number: $VERSION_NUMBER"
37-
echo "Using crate version: $CRATE_VERSION"
3834
3935
verify-version:
4036
name: Verify version matches tag
@@ -49,7 +45,7 @@ jobs:
4945
- name: Verify Cargo.toml version matches tag
5046
run: |
5147
TAG_VERSION="${{ needs.setup.outputs.version_number }}"
52-
CRATE_VERSION="${{ needs.setup.outputs.crate_version }}"
48+
CRATE_VERSION=$(grep "^version" Cargo.toml | head -1 | cut -d'"' -f2)
5349
5450
echo "Tag version: $TAG_VERSION"
5551
echo "Cargo.toml version: $CRATE_VERSION"
@@ -135,14 +131,17 @@ jobs:
135131
- name: Install Rust
136132
uses: dtolnay/rust-toolchain@stable
137133

134+
- name: Get Cargo version for checking
135+
run: |
136+
CRATE_VERSION=$(grep "^version" Cargo.toml | head -1 | cut -d'"' -f2)
137+
echo "CRATE_VERSION=$CRATE_VERSION" >> $GITHUB_ENV
138+
138139
- name: Authenticate with crates.io
139140
uses: rust-lang/crates-io-auth-action@v1
140141
id: auth
141142

142143
- name: Publish to crates.io
143144
run: |
144-
CRATE_VERSION="${{ needs.setup.outputs.crate_version }}"
145-
146145
# Try to publish, but don't fail if the version already exists
147146
OUTPUT=$(cargo publish --verbose 2>&1) && echo "$OUTPUT" || {
148147
EXIT_CODE=$?

0 commit comments

Comments
 (0)