Skip to content

Commit c70bdd3

Browse files
committed
Release v0.3.0
- Fixed bug with getting version from Cargo
1 parent 3f72703 commit c70bdd3

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,24 @@ jobs:
2929
- name: Checkout repository
3030
uses: actions/checkout@v4
3131

32-
- name: Extract version
32+
- name: Extract version (Unix)
3333
id: extract_version
34+
shell: bash
3435
run: |
35-
VERSION=$(grep '^version' Cargo.toml | head -n1 | cut -d '"' -f2)
36-
echo "VERSION=$VERSION" >> $GITHUB_ENV
36+
if [[ "${{ matrix.os }}" != "windows-latest" ]]; then
37+
VERSION=$(grep '^version' Cargo.toml | head -n1 | cut -d '"' -f2)
38+
echo "VERSION=$VERSION" >> $GITHUB_ENV
39+
fi
40+
41+
- name: Extract version (Windows)
42+
id: extract_version
43+
shell: pwsh
44+
run: |
45+
if ("${{ matrix.os }}" -eq "windows-latest") {
46+
$content = Get-Content Cargo.toml
47+
$version = ($content -match '^version\s*=\s*\"(.+?)\"')[0] -replace 'version\s*=\s*\"(.+?)\"', '$1'
48+
echo \"VERSION=$version\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
49+
}
3750
3851
- name: Install Rust target
3952
run: rustup target add ${{ matrix.target }}

0 commit comments

Comments
 (0)