mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-14 11:35:44 +00:00
71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
name: build
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
target: # windows linux macos
|
|
required: true
|
|
type: string
|
|
project:
|
|
required: false
|
|
type: string
|
|
default: './v2rayN.Desktop/v2rayN.Desktop.csproj'
|
|
|
|
jobs:
|
|
build:
|
|
name: build x64 arm64
|
|
strategy:
|
|
matrix:
|
|
arch: [ x64, arm64 ]
|
|
runs-on: |-
|
|
${{
|
|
case(
|
|
inputs.target == 'macos', 'macos-latest',
|
|
inputs.target == 'linux', 'ubuntu-24.04',
|
|
'ubuntu-latest'
|
|
)
|
|
}}
|
|
env:
|
|
Output: "${{ github.workspace }}/${{ matrix.arch }}"
|
|
RID: |-
|
|
${{
|
|
case(
|
|
inputs.target == 'macos', format('osx-{0}', matrix.arch),
|
|
inputs.target == 'windows', format('win-{0}', matrix.arch),
|
|
format('{0}-{1}', inputs.target, matrix.arch)
|
|
)
|
|
}}
|
|
Project: ${{ inputs.project }}
|
|
ExtOpt: |-
|
|
${{
|
|
case(
|
|
inputs.target == 'windows', '-p:EnableWindowsTargeting=true',
|
|
''
|
|
)
|
|
}}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6.0.2
|
|
with:
|
|
submodules: 'recursive'
|
|
fetch-depth: '0'
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v5.2.0
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: Build v2rayN
|
|
working-directory: ./v2rayN
|
|
run: dotnet publish $Project -c Release -r $RID -p:SelfContained=true $ExtOpt -o $Output
|
|
|
|
- name: Build AmazTool
|
|
working-directory: ./v2rayN
|
|
run: dotnet publish ./AmazTool/AmazTool.csproj -c Release -r $RID -p:SelfContained=true -p:PublishTrimmed=true $ExtOpt -o $Output
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v7.0.1
|
|
with:
|
|
name: ${{ matrix.arch }}
|
|
path: ${{ matrix.arch }}
|