Skip to content

Commit 45df8c5

Browse files
lklimekclaude
andcommitted
fix(ci): use cargo metadata instead of grep for version extraction
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2e840c3 commit 45df8c5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.github/workflows/flatpak.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
- name: Sync metainfo version from Cargo.toml
4141
run: |
42-
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
42+
VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "dash-evo-tool") | .version')
4343
if [ -z "$VERSION" ]; then
4444
echo "::error::Failed to extract version from Cargo.toml"
4545
exit 1

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
- name: Extract version from Cargo.toml
175175
id: version
176176
run: |
177-
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
177+
VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "dash-evo-tool") | .version')
178178
if [ -z "$VERSION" ]; then
179179
echo "::error::Failed to extract version from Cargo.toml"
180180
exit 1
@@ -485,7 +485,7 @@ jobs:
485485
- name: Extract version from Cargo.toml
486486
id: version
487487
run: |
488-
VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
488+
VERSION=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "dash-evo-tool") | .version')
489489
if [ -z "$VERSION" ]; then
490490
echo "::error::Failed to extract version from Cargo.toml"
491491
exit 1

0 commit comments

Comments
 (0)