mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 04:25:45 +00:00
refact workflow
This commit is contained in:
parent
53041906b3
commit
d1835a3baa
8 changed files with 237 additions and 199 deletions
69
.github/workflows/build-all.yml
vendored
69
.github/workflows/build-all.yml
vendored
|
|
@ -1,69 +0,0 @@
|
||||||
name: release all platforms
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
release_tag:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Trigger build windows
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
curl -X POST \
|
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
||||||
https://api.github.com/repos/${{ github.repository }}/actions/workflows/build-windows.yml/dispatches \
|
|
||||||
-d "{
|
|
||||||
\"ref\": \"master\",
|
|
||||||
\"inputs\": {
|
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
|
|
||||||
- name: Trigger build linux
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
curl -X POST \
|
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
||||||
https://api.github.com/repos/${{ github.repository }}/actions/workflows/build-linux.yml/dispatches \
|
|
||||||
-d "{
|
|
||||||
\"ref\": \"master\",
|
|
||||||
\"inputs\": {
|
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
|
|
||||||
- name: Trigger build osx
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
curl -X POST \
|
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
||||||
https://api.github.com/repos/${{ github.repository }}/actions/workflows/build-osx.yml/dispatches \
|
|
||||||
-d "{
|
|
||||||
\"ref\": \"master\",
|
|
||||||
\"inputs\": {
|
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
|
|
||||||
- name: Trigger build windows desktop
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
curl -X POST \
|
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
|
||||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
|
||||||
https://api.github.com/repos/${{ github.repository }}/actions/workflows/build-windows-desktop.yml/dispatches \
|
|
||||||
-d "{
|
|
||||||
\"ref\": \"master\",
|
|
||||||
\"inputs\": {
|
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
62
.github/workflows/build-linux.yml
vendored
62
.github/workflows/build-linux.yml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
name: release Linux
|
name: release Linux
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
release_tag:
|
release_tag:
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -16,46 +16,41 @@ permissions:
|
||||||
env:
|
env:
|
||||||
OutputArch: "linux-64"
|
OutputArch: "linux-64"
|
||||||
OutputArchArm: "linux-arm64"
|
OutputArchArm: "linux-arm64"
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/linux-64"
|
OutputPath64: "${{ github.workspace }}/v2rayN/Release/linux-x64"
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/linux-arm64"
|
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/linux-arm64"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
configuration: [Release]
|
arch: [ x64, arm64 ]
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
target: linux
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
|
release-zip:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
needs: build
|
||||||
|
if: inputs.release_tag != ''
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
|
- name: Restore build artifacts x64
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
submodules: 'recursive'
|
name: v2rayN-linux-x64
|
||||||
fetch-depth: '0'
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Restore build artifacts arm64
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
name: v2rayN-linux-arm64
|
||||||
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd v2rayN
|
|
||||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 -p:SelfContained=true -o "$OutputPath64"
|
|
||||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 -p:SelfContained=true -o "$OutputPathArm64"
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 -p:SelfContained=true -p:PublishTrimmed=true -o "$OutputPath64"
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 -p:SelfContained=true -p:PublishTrimmed=true -o "$OutputPathArm64"
|
|
||||||
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: actions/upload-artifact@v7.0.0
|
|
||||||
with:
|
|
||||||
name: v2rayN-linux
|
|
||||||
path: |
|
|
||||||
${{ github.workspace }}/v2rayN/Release/linux*
|
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
- name: Package release zip archive
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
run: |
|
||||||
chmod 755 package-release-zip.sh
|
chmod 755 package-release-zip.sh
|
||||||
./package-release-zip.sh "$OutputArch" "$OutputPath64"
|
./package-release-zip.sh "$OutputArch" "$OutputPath64"
|
||||||
|
|
@ -63,18 +58,19 @@ jobs:
|
||||||
|
|
||||||
- name: Upload zip archive to release
|
- name: Upload zip archive to release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
with:
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
file: ${{ github.workspace }}/v2rayN*.zip
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
tag: ${{ inputs.release_tag }}
|
||||||
file_glob: true
|
file_glob: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
deb:
|
deb:
|
||||||
needs: build
|
name: build and release deb
|
||||||
if: |
|
if: |
|
||||||
|
false && (
|
||||||
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') ||
|
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') ||
|
||||||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
||||||
|
)
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
container:
|
container:
|
||||||
image: debian:13
|
image: debian:13
|
||||||
|
|
@ -130,10 +126,12 @@ jobs:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
needs: build
|
name: build and release rpm
|
||||||
if: |
|
if: |
|
||||||
|
false && (
|
||||||
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') ||
|
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') ||
|
||||||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
||||||
|
)
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
container:
|
container:
|
||||||
image: registry.access.redhat.com/ubi10/ubi
|
image: registry.access.redhat.com/ubi10/ubi
|
||||||
|
|
@ -207,12 +205,6 @@ jobs:
|
||||||
submodules: 'recursive'
|
submodules: 'recursive'
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Restore build artifacts
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: v2rayN-linux
|
|
||||||
path: ${{ github.workspace }}/v2rayN/Release
|
|
||||||
|
|
||||||
- name: Ensure script permissions
|
- name: Ensure script permissions
|
||||||
run: chmod 755 package-rhel.sh
|
run: chmod 755 package-rhel.sh
|
||||||
|
|
||||||
|
|
|
||||||
95
.github/workflows/build-osx.yml
vendored
95
.github/workflows/build-osx.yml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
name: release macOS
|
name: release macOS
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
release_tag:
|
release_tag:
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -13,63 +13,39 @@ on:
|
||||||
env:
|
env:
|
||||||
OutputArch: "macos-64"
|
OutputArch: "macos-64"
|
||||||
OutputArchArm: "macos-arm64"
|
OutputArchArm: "macos-arm64"
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/macos-64"
|
OutputPath64: "${{ github.workspace }}/v2rayN/Release/macos-x64"
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/macos-arm64"
|
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/macos-arm64"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
configuration: [Release]
|
arch: [ x64, arm64 ]
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
target: macos
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
|
release-zip:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
needs: build
|
||||||
|
if: inputs.release_tag != ''
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v6.0.2
|
||||||
with:
|
|
||||||
submodules: 'recursive'
|
|
||||||
fetch-depth: '0'
|
|
||||||
|
|
||||||
- name: Setup
|
- name: Restore build artifacts x64
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
name: v2rayN-macos-x64
|
||||||
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
- name: Build
|
- name: Restore build artifacts arm64
|
||||||
run: |
|
uses: actions/download-artifact@v8
|
||||||
cd v2rayN
|
|
||||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 -p:SelfContained=true -o $OutputPath64
|
|
||||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 -p:SelfContained=true -o $OutputPathArm64
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-x64 -p:SelfContained=true -p:PublishTrimmed=true -o $OutputPath64
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 -p:SelfContained=true -p:PublishTrimmed=true -o $OutputPathArm64
|
|
||||||
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: actions/upload-artifact@v7.0.0
|
|
||||||
with:
|
with:
|
||||||
name: v2rayN-macos
|
name: v2rayN-macos-arm64
|
||||||
path: |
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
${{ github.workspace }}/v2rayN/Release/macos*
|
|
||||||
|
|
||||||
# release osx package
|
|
||||||
- name: Package osx
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
brew install create-dmg
|
|
||||||
chmod 755 package-osx.sh
|
|
||||||
./package-osx.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }}
|
|
||||||
./package-osx.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }}
|
|
||||||
|
|
||||||
- name: Upload dmg to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
|
||||||
file: ${{ github.workspace }}/v2rayN*.dmg
|
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
|
||||||
file_glob: true
|
|
||||||
prerelease: true
|
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
- name: Package release zip archive
|
||||||
if: github.event.inputs.release_tag != ''
|
if: github.event.inputs.release_tag != ''
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -84,4 +60,39 @@ jobs:
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
file: ${{ github.workspace }}/v2rayN*.zip
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
tag: ${{ github.event.inputs.release_tag }}
|
||||||
file_glob: true
|
file_glob: true
|
||||||
|
prerelease: true
|
||||||
|
|
||||||
|
release-dmg:
|
||||||
|
runs-on: macos-latest
|
||||||
|
needs: build
|
||||||
|
if: inputs.release_tag != ''
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
|
- name: Restore build artifacts x64
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: v2rayN-osx-x64
|
||||||
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
|
- name: Restore build artifacts arm64
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: v2rayN-osx-arm64
|
||||||
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
|
- name: Package osx
|
||||||
|
run: |
|
||||||
|
brew install create-dmg
|
||||||
|
chmod 755 package-osx.sh
|
||||||
|
./package-osx.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }}
|
||||||
|
./package-osx.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }}
|
||||||
|
|
||||||
|
- name: Upload dmg to release
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file: ${{ github.workspace }}/v2rayN*.dmg
|
||||||
|
tag: ${{ github.event.inputs.release_tag }}
|
||||||
|
file_glob: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
46
.github/workflows/build-windows-desktop.yml
vendored
46
.github/workflows/build-windows-desktop.yml
vendored
|
|
@ -13,47 +13,40 @@ on:
|
||||||
env:
|
env:
|
||||||
OutputArch: "windows-64"
|
OutputArch: "windows-64"
|
||||||
OutputArchArm: "windows-arm64"
|
OutputArchArm: "windows-arm64"
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-64"
|
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-desktop-64"
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
|
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-desktop-arm64"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
configuration: [Release]
|
arch: [ x64, arm64 ]
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
target: windows-desktop
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
|
release-zip:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: inputs.release_tag != ''
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
|
- name: Restore build artifacts x64
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
submodules: 'recursive'
|
name: v2rayN-windows-dekstop-x64
|
||||||
fetch-depth: '0'
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
- name: Setup
|
- name: Restore build artifacts arm64
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
name: v2rayN-windows-dekstop-arm64
|
||||||
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cd v2rayN
|
|
||||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPath64
|
|
||||||
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPath64
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPathArm64
|
|
||||||
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: actions/upload-artifact@v7.0.0
|
|
||||||
with:
|
|
||||||
name: v2rayN-windows-desktop
|
|
||||||
path: |
|
|
||||||
${{ github.workspace }}/v2rayN/Release/windows*
|
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
- name: Package release zip archive
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
run: |
|
||||||
chmod 755 package-release-zip.sh
|
chmod 755 package-release-zip.sh
|
||||||
./package-release-zip.sh $OutputArch $OutputPath64
|
./package-release-zip.sh $OutputArch $OutputPath64
|
||||||
|
|
@ -63,7 +56,6 @@ jobs:
|
||||||
|
|
||||||
- name: Upload zip archive to release
|
- name: Upload zip archive to release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
with:
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
file: ${{ github.workspace }}/v2rayN*.zip
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
tag: ${{ github.event.inputs.release_tag }}
|
||||||
|
|
|
||||||
45
.github/workflows/build-windows.yml
vendored
45
.github/workflows/build-windows.yml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
name: release Windows
|
name: release Windows
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
release_tag:
|
release_tag:
|
||||||
required: false
|
required: false
|
||||||
|
|
@ -13,44 +13,40 @@ on:
|
||||||
env:
|
env:
|
||||||
OutputArch: "windows-64"
|
OutputArch: "windows-64"
|
||||||
OutputArchArm: "windows-arm64"
|
OutputArchArm: "windows-arm64"
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-64"
|
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-x64"
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
|
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
configuration: [Release]
|
arch: [ x64, arm64 ]
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
target: windows
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
|
release-zip:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: inputs.release_tag != ''
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6.0.2
|
uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
- name: Setup
|
- name: Restore build artifacts x64
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
name: v2rayN-windows-x64
|
||||||
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
|
|
||||||
- name: Build
|
- name: Restore build artifacts arm64
|
||||||
run: |
|
uses: actions/download-artifact@v8
|
||||||
cd v2rayN
|
|
||||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPath64
|
|
||||||
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPath64
|
|
||||||
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPathArm64
|
|
||||||
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: actions/upload-artifact@v7.0.0
|
|
||||||
with:
|
with:
|
||||||
name: v2rayN-windows
|
name: v2rayN-windows-arm64
|
||||||
path: |
|
path: ${{ github.workspace }}/v2rayN/Release
|
||||||
${{ github.workspace }}/v2rayN/Release/windows*
|
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
- name: Package release zip archive
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
run: |
|
||||||
chmod 755 package-release-zip.sh
|
chmod 755 package-release-zip.sh
|
||||||
./package-release-zip.sh $OutputArch $OutputPath64
|
./package-release-zip.sh $OutputArch $OutputPath64
|
||||||
|
|
@ -58,7 +54,6 @@ jobs:
|
||||||
|
|
||||||
- name: Upload zip archive to release
|
- name: Upload zip archive to release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
with:
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
file: ${{ github.workspace }}/v2rayN*.zip
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
tag: ${{ github.event.inputs.release_tag }}
|
||||||
|
|
|
||||||
78
.github/workflows/build.yml
vendored
Normal file
78
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
name: build v2rayN
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
target: # windows linux macos windows-desktop
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
arch: # x64 arm64
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
|
||||||
|
OutputPath: "${{ github.workspace }}/v2rayN/Release/${{ inputs.target }}-${{ inputs.arch }}"
|
||||||
|
RID: |-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
inputs.target == macos, format('osx-{0}', inputs.arch),
|
||||||
|
startsWith(inputs.target, 'windows'), format('win-{0}', inputs.arch),
|
||||||
|
format('{0}-{1}', inputs.target, inputs.arch)
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
Project: |-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
inputs.target == 'windows', './v2rayN/v2rayN.csproj',
|
||||||
|
'./v2rayN.Desktop/v2rayN.Desktop.csproj'
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
ExtOpt: |-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
startsWith(inputs.target, 'windows'), '-p:EnableWindowsTargeting=true',
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: |-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
inputs.target == macos, 'macos-latest',
|
||||||
|
inputs.target == linux, 'ubuntu-24.04',
|
||||||
|
'ubuntu-latest'
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
|
||||||
|
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 ./AmazTool/AmazTool.csproj -c Release -r $RID -p:SelfContained=true -p:PublishTrimmed=true $ExtOpt -o $OutputPath
|
||||||
|
|
||||||
|
- name: Build AmazTool
|
||||||
|
working-directory: ./v2rayN
|
||||||
|
run: dotnet publish ./AmazTool/AmazTool.csproj -c Release -r $RID -p:SelfContained=true -p:PublishTrimmed=true $ExtOpt -o $OutputPath
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v7.0.0
|
||||||
|
with:
|
||||||
|
name: v2rayN-${{ inputs.target }}-${{ inputs.arch }}
|
||||||
|
path: |
|
||||||
|
${{ github.workspace }}/v2rayN/Release/${{ inputs.target }}-${{ inputs.arch }}
|
||||||
39
.github/workflows/release.yml
vendored
Normal file
39
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
name: release all platforms
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
release_tag:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
windows:
|
||||||
|
name: build and release windows
|
||||||
|
if: inputs.release_tag != ''
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
uses: ./.github/workflows/build-windows.yml
|
||||||
|
with:
|
||||||
|
release_tag: ${{ inputs.release_tag }}
|
||||||
|
|
||||||
|
linux:
|
||||||
|
name: build and release linux
|
||||||
|
if: inputs.release_tag != ''
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
uses: ./.github/workflows/build-linux.yml
|
||||||
|
with:
|
||||||
|
release_tag: ${{ inputs.release_tag }}
|
||||||
|
|
||||||
|
osx:
|
||||||
|
name: build and release osx
|
||||||
|
if: inputs.release_tag != ''
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
uses: ./.github/workflows/build-osx.yml
|
||||||
|
with:
|
||||||
|
release_tag: ${{ inputs.release_tag }}
|
||||||
|
|
@ -4,7 +4,7 @@ name: WinGet submission on release
|
||||||
# Modified by @MerrickZ https://github.com/anpho
|
# Modified by @MerrickZ https://github.com/anpho
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_call:
|
||||||
release:
|
release:
|
||||||
types: [released]
|
types: [released]
|
||||||
|
|
||||||
Loading…
Reference in a new issue