Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Dec 23, 2024
1 parent 7470b8b commit 247b599
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 41 deletions.
52 changes: 22 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 16 additions & 11 deletions v2rayN/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 `
Expand All @@ -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 `
Expand All @@ -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 `
Expand All @@ -41,22 +44,24 @@ dotnet publish `
--self-contained true `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-o "$OutputPath/linux-arm64"
-o $OutputPathLinuxArm64


if ( -Not $? ) {
exit $lastExitCode
}

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

0 comments on commit 247b599

Please sign in to comment.