Skip to content

Commit

Permalink
fix: 修复 sed 语法
Browse files Browse the repository at this point in the history
  • Loading branch information
KonghaYao committed Jan 5, 2025
1 parent 1d0d212 commit bb298f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/cross-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@ jobs:
scoop install main/nodejs
${{ matrix.platform.setup }}
- name: Change Version Windows
if: ${{ matrix.platform.name == 'Windows' }}
if: ${{ runner.os == 'Windows' }}
run: |
(Get-Content -Path .\Cargo.toml -Raw) -replace 'version\s*=\s*".*?"', "version = `"${{inputs.version}}`"" |
Set-Content -Path .\Cargo.toml
shell: pwsh
- name: Change Version Linux
if: ${{ matrix.platform.name != 'linux' }}
if: ${{ runner.os == 'Linux' }}
run: |
sed -i 's/^version = \"[^\"]*\"/version = "${{inputs.version}}"/' Cargo.toml
- name: Change Version Mac
if: ${{ runner.os == 'macOS' }}
run: |
sed -i '' 's/^version = \"[^\"]*\"/version = "${{inputs.version}}"/' Cargo.toml
- name: Setup Linux Environment
Expand Down Expand Up @@ -182,7 +186,7 @@ jobs:
sudo apt install -y llvm clang pkg-config libssl-dev protobuf-compiler
- name: Change Version Linux
run: |
sed -i '' 's/^version = \"[^\"]*\"/version = "${{inputs.version}}"/' Cargo.toml
sed -i 's/^version = \"[^\"]*\"/version = "${{inputs.version}}"/' Cargo.toml
- name: Setup WASI Environment
working-directory: .
run: |
Expand Down

0 comments on commit bb298f5

Please sign in to comment.