File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff 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 }}
You can’t perform that action at this time.
0 commit comments