From 247b59985fd08ef4d958a9d73954eaae51a03f8a Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Mon, 23 Dec 2024 11:31:56 +0800 Subject: [PATCH] update build --- .github/workflows/build.yml | 52 ++++++++++++++++--------------------- v2rayN/build.ps1 | 27 +++++++++++-------- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa803b78..7799f154 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,43 +18,35 @@ jobs: - name: Checkout uses: actions/checkout@v4 - # - name: 删除工作流运行 - # uses: Mattraks/delete-workflow-runs@v2 - # with: - # token: ${{ github.token }} - # repository: ${{ github.repository }} - # retain_days: 0 - # keep_minimum_runs: 1 - - name: Build run: cd v2rayN && ./build.ps1 - # - name: Package - # shell: pwsh - # run: | - # 7z a -mx9 ..\v2rayN.7z $env:Wap_Project_Directory + - 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 + name: v2rayN-windows-arm64 path: | - ./v2rayN/v2rayN.zip + ./v2rayN/v2rayN-windows-arm64.zip + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: v2rayN-linux-64 + path: | + ./v2rayN/v2rayN-linux-64.zip - # - name: Release - # uses: softprops/action-gh-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} - # with: - # prerelease: ${{ contains(github.ref, '-') }} - # draft: false - # files: | - # .\v2rayN\v2rayN.zip - # body: | - # [![](https://img.shields.io/badge/Telegram-Channel-blue)](https://t.me/netch_channel) [![](https://img.shields.io/badge/Telegram-Group-green)](https://t.me/netch_group) - # ## Changelogs - # * This is an automated deployment of GitHub Actions, the change log should be updated manually soon - - # ## 更新日志 - # * 这是 GitHub Actions 自动化部署,更新日志应该很快会手动更新 + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: v2rayN-linux-arm64 + path: | + ./v2rayN/v2rayN-linux-arm64.zip + diff --git a/v2rayN/build.ps1 b/v2rayN/build.ps1 index 35a518d8..349de318 100644 --- a/v2rayN/build.ps1 +++ b/v2rayN/build.ps1 @@ -2,7 +2,10 @@ param ( [Parameter()] [ValidateNotNullOrEmpty()] [string] - $OutputPath = './bin/v2rayN' + $OutputPathWin64 = './bin/v2rayN/win-x64', + $OutputPathWinArm64 = './bin/v2rayN/win-arm64', + $OutputPathLinux64 = './bin/v2rayN/linux-x64', + $OutputPathLinuxArm64 = './bin/v2rayN/linux-arm64' ) Write-Host 'Building' @@ -14,7 +17,7 @@ dotnet publish ` --self-contained false ` -p:PublishReadyToRun=false ` -p:PublishSingleFile=true ` - -o "$OutputPath/win-x64" + -o $OutputPathWin64 dotnet publish ` ./v2rayN/v2rayN.csproj ` @@ -23,7 +26,7 @@ dotnet publish ` --self-contained false ` -p:PublishReadyToRun=false ` -p:PublishSingleFile=true ` - -o "$OutputPath/win-arm64" + -o $OutputPathWinArm64 dotnet publish ` ./v2rayN.Desktop/v2rayN.Desktop.csproj ` @@ -32,7 +35,7 @@ dotnet publish ` --self-contained true ` -p:PublishReadyToRun=false ` -p:PublishSingleFile=true ` - -o "$OutputPath/linux-x64" + -o $OutputPathLinux64 dotnet publish ` ./v2rayN.Desktop/v2rayN.Desktop.csproj ` @@ -41,7 +44,7 @@ dotnet publish ` --self-contained true ` -p:PublishReadyToRun=false ` -p:PublishSingleFile=true ` - -o "$OutputPath/linux-arm64" + -o $OutputPathLinuxArm64 if ( -Not $? ) { @@ -49,14 +52,16 @@ if ( -Not $? ) { } if ( Test-Path -Path ./bin/v2rayN ) { - rm -Force "$OutputPath/win-x64/*.pdb" - rm -Force "$OutputPath/win-arm64/*.pdb" - rm -Force "$OutputPath/linux-x64/*.pdb" - rm -Force "$OutputPath/linux-arm64/*.pdb" + rm -Force "$OutputPathWin64/*.pdb" + rm -Force "$OutputPathWinArm64/*.pdb" + rm -Force "$OutputPathLinux64/*.pdb" + rm -Force "$OutputPathLinuxArm64/*.pdb" } Write-Host 'Build done' -ls $OutputPath -7z a v2rayN.zip $OutputPath +7z a v2rayN-windows-64.zip $OutputPathWin64 +7z a v2rayN-windows-arm64.zip $OutputPathWinArm64 +7z a v2rayN-linux-64.zip $OutputPathLinux64 +7z a v2rayN-linux-arm64.zip $OutputPathLinuxArm64 exit 0 \ No newline at end of file