update build

pull/6333/head
2dust 2024-12-23 17:34:06 +08:00
parent 25fddc3c71
commit 8ee00907b7
6 changed files with 62 additions and 47 deletions

32
.github/workflows/build-linux.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: release Linux
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 &&
./build-linux.sh
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: v2rayN-linux
path: |
./v2rayN/v2rayN-linux.zip

View File

@ -1,4 +1,4 @@
name: release macos
name: release macOS
on:
push:

View File

@ -1,4 +1,4 @@
name: release
name: release Windows
on:
push:
@ -36,17 +36,6 @@ jobs:
path: |
./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: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: v2rayN-linux-arm64
path: |
./v2rayN/v2rayN-linux-arm64.zip

18
v2rayN/build-linux.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
echo 'Building Linux'
OutputPath='./bin/v2rayN'
OutputPath64="${OutputPath}/linux-x64"
OutputPathArm64="${OutputPath}/linux-arm64"
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
rm -rf "$OutputPath64/*.pdb"
rm -rf "$OutputPathArm64/*.pdb"
echo 'Build done'
7z a v2rayN-linux.zip $OutputPath
exit 0

View File

@ -1,17 +1,18 @@
#!/bin/sh
echo 'Building'
echo 'Building macOS'
OutputPath='./bin/v2rayN'
OutputPath64="${OutputPath}/osx-x64"
OutputPathArm64="${OutputPath}/osx-arm64"
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o "${OutputPath}/osx-x64"
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o "${OutputPath}/osx-arm64"
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
rm -rf "$OutputPath/osx-x64/*.pdb"
rm -rf "$OutputPath/osx-arm64/*.pdb"
rm -rf "$OutputPath64/*.pdb"
rm -rf "$OutputPathArm64/*.pdb"
echo 'Build done'
ls $OutputPath
7z a v2rayN-osx.zip $OutputPath
exit 0

View File

@ -4,11 +4,9 @@ param (
[string]
$OutputPathWin64 = './bin/v2rayN/win-x64',
$OutputPathWinArm64 = './bin/v2rayN/win-arm64',
$OutputPathLinux64 = './bin/v2rayN/linux-x64',
$OutputPathLinuxArm64 = './bin/v2rayN/linux-arm64'
)
Write-Host 'Building'
Write-Host 'Building Windows'
dotnet publish `
./v2rayN/v2rayN.csproj `
@ -28,25 +26,6 @@ dotnet publish `
-p:PublishSingleFile=true `
-o $OutputPathWinArm64
dotnet publish `
./v2rayN.Desktop/v2rayN.Desktop.csproj `
-c Release `
-r linux-x64 `
--self-contained true `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-o $OutputPathLinux64
dotnet publish `
./v2rayN.Desktop/v2rayN.Desktop.csproj `
-c Release `
-r linux-arm64 `
--self-contained true `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-o $OutputPathLinuxArm64
if ( -Not $? ) {
exit $lastExitCode
}
@ -54,14 +33,10 @@ if ( -Not $? ) {
if ( Test-Path -Path ./bin/v2rayN ) {
rm -Force "$OutputPathWin64/*.pdb"
rm -Force "$OutputPathWinArm64/*.pdb"
rm -Force "$OutputPathLinux64/*.pdb"
rm -Force "$OutputPathLinuxArm64/*.pdb"
}
Write-Host 'Build done'
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