From 5d0dec85a649d85e36406c14fbb50f515d78ad51 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Mon, 10 Mar 2025 00:36:59 +0800 Subject: [PATCH] ci: use Compress-Archive in Windows try to prevent Defender false positives --- .github/workflows/package.yml | 5 +++-- build/scripts/package.windows.sh | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 5cfb8a78..2dfc97fd 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -9,10 +9,10 @@ on: jobs: windows: name: Package Windows - runs-on: ubuntu-latest + runs-on: windows-2019 strategy: matrix: - runtime: [win-x64, win-arm64] + runtime: [ win-x64, win-arm64 ] steps: - name: Checkout sources uses: actions/checkout@v4 @@ -22,6 +22,7 @@ jobs: name: sourcegit.${{ matrix.runtime }} path: build/SourceGit - name: Package + shell: bash env: VERSION: ${{ inputs.version }} RUNTIME: ${{ matrix.runtime }} diff --git a/build/scripts/package.windows.sh b/build/scripts/package.windows.sh index 6bd3879b..1a8f99c1 100755 --- a/build/scripts/package.windows.sh +++ b/build/scripts/package.windows.sh @@ -9,4 +9,8 @@ cd build rm -rf SourceGit/*.pdb -zip "sourcegit_$VERSION.$RUNTIME.zip" -r SourceGit +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