From 5ce919ab66eaf622ea131da36ed2170c972d8494 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 28 Jul 2025 20:43:39 +0800 Subject: [PATCH] ci: use `pwsh` to make Windows packages instead of `bash` Signed-off-by: leo --- .github/workflows/package.yml | 4 ++-- build/scripts/package.win.ps1 | 2 ++ build/scripts/package.windows.sh | 16 ---------------- 3 files changed, 4 insertions(+), 18 deletions(-) create mode 100644 build/scripts/package.win.ps1 delete mode 100755 build/scripts/package.windows.sh diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 37d8afba..d203dd2e 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -22,11 +22,11 @@ jobs: name: sourcegit.${{ matrix.runtime }} path: build/SourceGit - name: Package - shell: bash + shell: pwsh env: VERSION: ${{ inputs.version }} RUNTIME: ${{ matrix.runtime }} - run: ./build/scripts/package.windows.sh + run: ./build/scripts/package.win.ps1 - name: Upload package artifact uses: actions/upload-artifact@v4 with: diff --git a/build/scripts/package.win.ps1 b/build/scripts/package.win.ps1 new file mode 100644 index 00000000..04cd0713 --- /dev/null +++ b/build/scripts/package.win.ps1 @@ -0,0 +1,2 @@ +Remove-Item -Path build\SourceGit\*.pdb -Force +Compress-Archive -Path build\SourceGit -DestinationPath "build\sourcegit_${env:VERSION}.${env:RUNTIME}.zip" -Force \ No newline at end of file diff --git a/build/scripts/package.windows.sh b/build/scripts/package.windows.sh deleted file mode 100755 index c22a9d35..00000000 --- a/build/scripts/package.windows.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o -set -u -set pipefail - -cd build - -rm -rf SourceGit/*.pdb - -if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" ]]; then - powershell -Command "Compress-Archive -Path SourceGit -DestinationPath \"sourcegit_$VERSION.$RUNTIME.zip\" -Force" -else - zip "sourcegit_$VERSION.$RUNTIME.zip" -r SourceGit -fi