From eafa20032bd8ca2060d61b423c5d33b09dd2c71b Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Wed, 25 Dec 2024 17:06:03 +0800 Subject: [PATCH] Modify the build windows script --- .github/workflows/build-windows.yml | 39 +++++++++++++++++++++++++++ .github/workflows/build.yml | 41 ---------------------------- v2rayN/build.ps1 | 42 ----------------------------- 3 files changed, 39 insertions(+), 83 deletions(-) create mode 100644 .github/workflows/build-windows.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 v2rayN/build.ps1 diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 00000000000..778c072986c --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,39 @@ +name: release Windows + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + strategy: + matrix: + configuration: [Release] + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + run: | + cd v2rayN + OutputPath='./bin/v2rayN' + OutputPath64="${OutputPath}/win-x64" + OutputPathArm64="${OutputPath}/win-arm64" + dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64 + dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64 + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: v2rayN-windows + path: | + ./v2rayN/bin/v2rayN + + + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 646fe435a46..00000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: release Windows - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - strategy: - matrix: - configuration: [Release] - - runs-on: windows-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build - run: cd v2rayN && - ./build.ps1 - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: v2rayN-windows-64 - path: | - ./v2rayN/v2rayN-windows-64.zip - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: v2rayN-windows-arm64 - path: | - ./v2rayN/v2rayN-windows-arm64.zip - - - - diff --git a/v2rayN/build.ps1 b/v2rayN/build.ps1 deleted file mode 100644 index 6f0ae28d975..00000000000 --- a/v2rayN/build.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -param ( - [Parameter()] - [ValidateNotNullOrEmpty()] - [string] - $OutputPathWin64 = './bin/v2rayN/win-x64', - $OutputPathWinArm64 = './bin/v2rayN/win-arm64' -) - -Write-Host 'Building Windows' - -dotnet publish ` - ./v2rayN/v2rayN.csproj ` - -c Release ` - -r win-x64 ` - --self-contained false ` - -p:PublishReadyToRun=false ` - -p:PublishSingleFile=true ` - -o $OutputPathWin64 - -dotnet publish ` - ./v2rayN/v2rayN.csproj ` - -c Release ` - -r win-arm64 ` - --self-contained false ` - -p:PublishReadyToRun=false ` - -p:PublishSingleFile=true ` - -o $OutputPathWinArm64 - -if ( -Not $? ) { - exit $lastExitCode - } - -if ( Test-Path -Path ./bin/v2rayN ) { - rm -Force "$OutputPathWin64/*.pdb" - rm -Force "$OutputPathWinArm64/*.pdb" -} - -Write-Host 'Build done' - -7z a v2rayN-windows-64.zip $OutputPathWin64 -7z a v2rayN-windows-arm64.zip $OutputPathWinArm64 -exit 0 \ No newline at end of file