update build

pull/6333/head
2dust 2024-12-23 11:31:56 +08:00
parent 7470b8b6d3
commit 247b59985f
2 changed files with 38 additions and 41 deletions

View File

@ -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

View File

@ -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