mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-14 11:35:44 +00:00
Merge 4a762bf691 into 495b5db4f1
This commit is contained in:
commit
63f114bbc4
8 changed files with 230 additions and 269 deletions
18
.github/workflows/build-all.yml
vendored
18
.github/workflows/build-all.yml
vendored
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Trigger build windows
|
- name: Trigger build windows
|
||||||
if: github.event.inputs.release_tag != ''
|
if: inputs.release_tag != ''
|
||||||
run: |
|
run: |
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
|
|
@ -22,12 +22,12 @@ jobs:
|
||||||
-d "{
|
-d "{
|
||||||
\"ref\": \"master\",
|
\"ref\": \"master\",
|
||||||
\"inputs\": {
|
\"inputs\": {
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
\"release_tag\": \"${{ inputs.release_tag }}\"
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
|
|
||||||
- name: Trigger build linux
|
- name: Trigger build linux
|
||||||
if: github.event.inputs.release_tag != ''
|
if: inputs.release_tag != ''
|
||||||
run: |
|
run: |
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
|
|
@ -36,12 +36,12 @@ jobs:
|
||||||
-d "{
|
-d "{
|
||||||
\"ref\": \"master\",
|
\"ref\": \"master\",
|
||||||
\"inputs\": {
|
\"inputs\": {
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
\"release_tag\": \"${{ inputs.release_tag }}\"
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
|
|
||||||
- name: Trigger build osx
|
- name: Trigger build osx
|
||||||
if: github.event.inputs.release_tag != ''
|
if: inputs.release_tag != ''
|
||||||
run: |
|
run: |
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
|
|
@ -50,12 +50,12 @@ jobs:
|
||||||
-d "{
|
-d "{
|
||||||
\"ref\": \"master\",
|
\"ref\": \"master\",
|
||||||
\"inputs\": {
|
\"inputs\": {
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
\"release_tag\": \"${{ inputs.release_tag }}\"
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
|
|
||||||
- name: Trigger build windows desktop
|
- name: Trigger build windows desktop
|
||||||
if: github.event.inputs.release_tag != ''
|
if: inputs.release_tag != ''
|
||||||
run: |
|
run: |
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Accept: application/vnd.github.v3+json" \
|
-H "Accept: application/vnd.github.v3+json" \
|
||||||
|
|
@ -64,6 +64,6 @@ jobs:
|
||||||
-d "{
|
-d "{
|
||||||
\"ref\": \"master\",
|
\"ref\": \"master\",
|
||||||
\"inputs\": {
|
\"inputs\": {
|
||||||
\"release_tag\": \"${{ github.event.inputs.release_tag }}\"
|
\"release_tag\": \"${{ inputs.release_tag }}\"
|
||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
|
|
|
||||||
105
.github/workflows/build-linux.yml
vendored
105
.github/workflows/build-linux.yml
vendored
|
|
@ -13,73 +13,29 @@ on:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
env:
|
|
||||||
OutputArch: "linux-64"
|
|
||||||
OutputArchArm: "linux-arm64"
|
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/linux-64"
|
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/linux-arm64"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
uses: ./.github/workflows/build.yml
|
||||||
matrix:
|
with:
|
||||||
configuration: [Release]
|
target: linux
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
release-zip:
|
||||||
- name: Checkout
|
if: inputs.release_tag != ''
|
||||||
uses: actions/checkout@v6.0.2
|
needs: build
|
||||||
with:
|
uses: ./.github/workflows/package-zip.yml
|
||||||
submodules: 'recursive'
|
with:
|
||||||
fetch-depth: '0'
|
target: linux
|
||||||
|
release_tag: ${{ inputs.release_tag }}
|
||||||
- name: Setup .NET
|
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
|
||||||
with:
|
|
||||||
dotnet-version: '8.0.x'
|
|
||||||
|
|
||||||
- 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.1
|
|
||||||
with:
|
|
||||||
name: v2rayN-linux
|
|
||||||
path: |
|
|
||||||
${{ github.workspace }}/v2rayN/Release/linux*
|
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
chmod 755 package-release-zip.sh
|
|
||||||
./package-release-zip.sh "$OutputArch" "$OutputPath64"
|
|
||||||
./package-release-zip.sh "$OutputArchArm" "$OutputPathArm64"
|
|
||||||
|
|
||||||
- name: Upload zip archive to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
|
||||||
file_glob: true
|
|
||||||
prerelease: true
|
|
||||||
|
|
||||||
deb:
|
deb:
|
||||||
needs: build
|
name: build and release deb
|
||||||
if: |
|
if: |
|
||||||
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') ||
|
(github.event_name == 'workflow_dispatch' && 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-latest
|
||||||
container:
|
container: debian:13
|
||||||
image: debian:13
|
|
||||||
env:
|
env:
|
||||||
RELEASE_TAG: ${{ github.event.inputs.release_tag != '' && github.event.inputs.release_tag || github.ref_name }}
|
RELEASE_TAG: ${{ case(inputs.release_tag != '', inputs.release_tag, github.ref_name) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare tools (Debian)
|
- name: Prepare tools (Debian)
|
||||||
|
|
@ -115,12 +71,6 @@ jobs:
|
||||||
echo "==== Dist tree ===="
|
echo "==== Dist tree ===="
|
||||||
ls -R "$GITHUB_WORKSPACE/dist/deb" || true
|
ls -R "$GITHUB_WORKSPACE/dist/deb" || true
|
||||||
|
|
||||||
- name: Upload DEB artifacts
|
|
||||||
uses: actions/upload-artifact@v7.0.1
|
|
||||||
with:
|
|
||||||
name: v2rayN-deb
|
|
||||||
path: dist/deb/**/*.deb
|
|
||||||
|
|
||||||
- name: Upload DEBs to release
|
- name: Upload DEBs to release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -130,15 +80,14 @@ jobs:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
needs: build
|
name: build and release rpm
|
||||||
if: |
|
if: |
|
||||||
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') ||
|
(github.event_name == 'workflow_dispatch' && 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-latest
|
||||||
container:
|
container: registry.access.redhat.com/ubi10/ubi
|
||||||
image: registry.access.redhat.com/ubi10/ubi
|
|
||||||
env:
|
env:
|
||||||
RELEASE_TAG: ${{ github.event.inputs.release_tag != '' && github.event.inputs.release_tag || github.ref_name }}
|
RELEASE_TAG: ${{ case(inputs.release_tag != '', inputs.release_tag, github.ref_name) }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare tools (Red Hat)
|
- name: Prepare tools (Red Hat)
|
||||||
|
|
@ -207,12 +156,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
|
||||||
|
|
||||||
|
|
@ -227,13 +170,7 @@ jobs:
|
||||||
find "$GITHUB_WORKSPACE/dist/rpm" -name "v2rayN-*-1*.aarch64.rpm" -exec mv {} "$GITHUB_WORKSPACE/dist/rpm/v2rayN-linux-rhel-arm64.rpm" \; || true
|
find "$GITHUB_WORKSPACE/dist/rpm" -name "v2rayN-*-1*.aarch64.rpm" -exec mv {} "$GITHUB_WORKSPACE/dist/rpm/v2rayN-linux-rhel-arm64.rpm" \; || true
|
||||||
echo "==== Dist tree ===="
|
echo "==== Dist tree ===="
|
||||||
ls -R "$GITHUB_WORKSPACE/dist/rpm" || true
|
ls -R "$GITHUB_WORKSPACE/dist/rpm" || true
|
||||||
|
|
||||||
- name: Upload RPM artifacts
|
|
||||||
uses: actions/upload-artifact@v7.0.1
|
|
||||||
with:
|
|
||||||
name: v2rayN-rpm
|
|
||||||
path: dist/rpm/**/*.rpm
|
|
||||||
|
|
||||||
- name: Upload RPMs to release
|
- name: Upload RPMs to release
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
96
.github/workflows/build-osx.yml
vendored
96
.github/workflows/build-osx.yml
vendored
|
|
@ -10,78 +10,62 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
permissions:
|
||||||
OutputArch: "macos-64"
|
contents: write
|
||||||
OutputArchArm: "macos-arm64"
|
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/macos-64"
|
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/macos-arm64"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
uses: ./.github/workflows/build.yml
|
||||||
|
with:
|
||||||
|
target: macos
|
||||||
|
|
||||||
|
release-zip:
|
||||||
|
if: inputs.release_tag != ''
|
||||||
|
needs: build
|
||||||
|
uses: ./.github/workflows/package-zip.yml
|
||||||
|
with:
|
||||||
|
target: macos
|
||||||
|
release_tag: ${{ inputs.release_tag }}
|
||||||
|
|
||||||
|
dmg:
|
||||||
|
name: package and release macOS dmg
|
||||||
|
if: inputs.release_tag != ''
|
||||||
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
configuration: [Release]
|
arch: [ x64, arm64 ]
|
||||||
|
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
env:
|
||||||
|
Arch: |-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
matrix.arch == 'x64', '64',
|
||||||
|
matrix.arch
|
||||||
|
)
|
||||||
|
}}
|
||||||
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
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
uses: actions/download-artifact@v8
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
name: ${{ matrix.arch }}
|
||||||
|
path: v2rayN-macos-${{ env.Arch }}
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
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.1
|
|
||||||
with:
|
|
||||||
name: v2rayN-macos
|
|
||||||
path: |
|
|
||||||
${{ github.workspace }}/v2rayN/Release/macos*
|
|
||||||
|
|
||||||
# release osx package
|
- name: Setup create-dmg
|
||||||
- name: Package osx
|
run: brew install create-dmg
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
- name: Ensure script permissions
|
||||||
brew install create-dmg
|
run: chmod 755 package-osx.sh
|
||||||
chmod 755 package-osx.sh
|
|
||||||
./package-osx.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }}
|
- name: Package dmg
|
||||||
./package-osx.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }}
|
run: ./package-osx.sh macos-$Arch v2rayN-macos-$Arch ${{ inputs.release_tag }}
|
||||||
|
|
||||||
- name: Upload dmg to release
|
- name: Upload dmg 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*.dmg
|
file: ${{ github.workspace }}/v2rayN*.dmg
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
tag: ${{ inputs.release_tag }}
|
||||||
file_glob: true
|
file_glob: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
chmod 755 package-release-zip.sh
|
|
||||||
./package-release-zip.sh $OutputArch $OutputPath64
|
|
||||||
./package-release-zip.sh $OutputArchArm $OutputPathArm64
|
|
||||||
|
|
||||||
- name: Upload zip archive to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
|
||||||
file_glob: true
|
|
||||||
prerelease: true
|
|
||||||
67
.github/workflows/build-windows-desktop.yml
vendored
67
.github/workflows/build-windows-desktop.yml
vendored
|
|
@ -10,62 +10,19 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
permissions:
|
||||||
OutputArch: "windows-64"
|
contents: write
|
||||||
OutputArchArm: "windows-arm64"
|
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-64"
|
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
uses: ./.github/workflows/build.yml
|
||||||
matrix:
|
with:
|
||||||
configuration: [Release]
|
target: windows
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
release-zip:
|
||||||
|
if: inputs.release_tag != ''
|
||||||
steps:
|
needs: build
|
||||||
- name: Checkout
|
uses: ./.github/workflows/package-zip.yml
|
||||||
uses: actions/checkout@v6.0.2
|
with:
|
||||||
with:
|
target: windows-desktop
|
||||||
submodules: 'recursive'
|
release_tag: ${{ inputs.release_tag }}
|
||||||
fetch-depth: '0'
|
|
||||||
|
|
||||||
- name: Setup
|
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
|
||||||
with:
|
|
||||||
dotnet-version: '8.0.x'
|
|
||||||
|
|
||||||
- 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.1
|
|
||||||
with:
|
|
||||||
name: v2rayN-windows-desktop
|
|
||||||
path: |
|
|
||||||
${{ github.workspace }}/v2rayN/Release/windows*
|
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
chmod 755 package-release-zip.sh
|
|
||||||
./package-release-zip.sh $OutputArch $OutputPath64
|
|
||||||
mv "v2rayN-${OutputArch}.zip" "v2rayN-${OutputArch}-desktop.zip"
|
|
||||||
./package-release-zip.sh $OutputArchArm $OutputPathArm64
|
|
||||||
mv "v2rayN-${OutputArchArm}.zip" "v2rayN-${OutputArchArm}-desktop.zip"
|
|
||||||
|
|
||||||
- name: Upload zip archive to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
|
||||||
file_glob: true
|
|
||||||
prerelease: true
|
|
||||||
|
|
|
||||||
63
.github/workflows/build-windows.yml
vendored
63
.github/workflows/build-windows.yml
vendored
|
|
@ -10,57 +10,20 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
env:
|
permissions:
|
||||||
OutputArch: "windows-64"
|
contents: write
|
||||||
OutputArchArm: "windows-arm64"
|
|
||||||
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-64"
|
|
||||||
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
uses: ./.github/workflows/build.yml
|
||||||
matrix:
|
with:
|
||||||
configuration: [Release]
|
target: windows
|
||||||
|
project: ./v2rayN/v2rayN.csproj
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
release-zip:
|
||||||
|
if: inputs.release_tag != ''
|
||||||
steps:
|
needs: build
|
||||||
- name: Checkout
|
uses: ./.github/workflows/package-zip.yml
|
||||||
uses: actions/checkout@v6.0.2
|
with:
|
||||||
|
target: windows
|
||||||
- name: Setup
|
release_tag: ${{ inputs.release_tag }}
|
||||||
uses: actions/setup-dotnet@v5.2.0
|
|
||||||
with:
|
|
||||||
dotnet-version: '8.0.x'
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
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.1
|
|
||||||
with:
|
|
||||||
name: v2rayN-windows
|
|
||||||
path: |
|
|
||||||
${{ github.workspace }}/v2rayN/Release/windows*
|
|
||||||
|
|
||||||
# release zip archive
|
|
||||||
- name: Package release zip archive
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
run: |
|
|
||||||
chmod 755 package-release-zip.sh
|
|
||||||
./package-release-zip.sh $OutputArch $OutputPath64
|
|
||||||
./package-release-zip.sh $OutputArchArm $OutputPathArm64
|
|
||||||
|
|
||||||
- name: Upload zip archive to release
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
if: github.event.inputs.release_tag != ''
|
|
||||||
with:
|
|
||||||
file: ${{ github.workspace }}/v2rayN*.zip
|
|
||||||
tag: ${{ github.event.inputs.release_tag }}
|
|
||||||
file_glob: true
|
|
||||||
prerelease: true
|
|
||||||
|
|
|
||||||
71
.github/workflows/build.yml
vendored
Normal file
71
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
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 }}
|
||||||
64
.github/workflows/package-zip.yml
vendored
Normal file
64
.github/workflows/package-zip.yml
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
name: package and release Zip
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
release_tag:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
target: # windows linux macos windows-desktop
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package:
|
||||||
|
name: package x64 arm64
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [ x64, arm64 ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
Target: |-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
inputs.target == 'windows-desktop', 'windows',
|
||||||
|
inputs.target
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
Arch: |-
|
||||||
|
${{
|
||||||
|
case(
|
||||||
|
matrix.arch == 'x64', '64',
|
||||||
|
matrix.arch
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6.0.2
|
||||||
|
|
||||||
|
- name: Restore build artifacts
|
||||||
|
uses: actions/download-artifact@v8
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.arch }}
|
||||||
|
path: v2rayN-${{ env.Target }}-${{ env.Arch }}
|
||||||
|
|
||||||
|
- name: Get v2rayN-core-bin
|
||||||
|
run: wget -nv -O v2rayN-$Target-$Arch.zip "https://github.com/2dust/v2rayN-core-bin/raw/refs/heads/master/v2rayN-$Target-$Arch.zip"
|
||||||
|
|
||||||
|
- name: Package zip archive
|
||||||
|
run: 7z a -tZip v2rayN-$Target-$Arch.zip v2rayN-$Target-$Arch -mx1
|
||||||
|
|
||||||
|
- name: Rename windows-desktop
|
||||||
|
if: inputs.target == 'windows-desktop'
|
||||||
|
run: mv "v2rayN-$Target-$Arch.zip" "v2rayN-$Target-$Arch-desktop.zip"
|
||||||
|
|
||||||
|
- name: Upload zip archive to release
|
||||||
|
uses: svenstaro/upload-release-action@v2
|
||||||
|
with:
|
||||||
|
file: ${{ github.workspace }}/v2rayN*.zip
|
||||||
|
tag: ${{ inputs.release_tag }}
|
||||||
|
file_glob: true
|
||||||
|
prerelease: true
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
Arch="$1"
|
|
||||||
OutputPath="$2"
|
|
||||||
|
|
||||||
OutputArch="v2rayN-${Arch}"
|
|
||||||
FileName="v2rayN-${Arch}.zip"
|
|
||||||
|
|
||||||
wget -nv -O $FileName "https://github.com/2dust/v2rayN-core-bin/raw/refs/heads/master/$FileName"
|
|
||||||
|
|
||||||
ZipPath64="./$OutputArch"
|
|
||||||
mkdir $ZipPath64
|
|
||||||
|
|
||||||
cp -rf $OutputPath "$ZipPath64/$OutputArch"
|
|
||||||
7z a -tZip $FileName "$ZipPath64/$OutputArch" -mx1
|
|
||||||
Loading…
Reference in a new issue