From c0e8f79bb62cdf7d1a75ebca21e331121a686772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E5=A4=8F=E5=B0=A7?= <3446798488@qq.com> Date: Sun, 5 Jan 2025 10:17:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20sed=20=E8=AF=AD?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cross-build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cross-build.yml b/.github/workflows/cross-build.yml index b5d4f14..ea540ed 100644 --- a/.github/workflows/cross-build.yml +++ b/.github/workflows/cross-build.yml @@ -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}}`"" | + (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 @@ -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: |