Code clean #113
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release Linux | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
required: false | |
type: string | |
push: | |
branches: | |
- master | |
env: | |
OutputArch: "linux-64" | |
OutputArchArm: "linux-arm64" | |
OutputPath64: "${{ github.workspace }}/v2rayN/Release/linux-64" | |
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/linux-arm64" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Release] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup | |
uses: actions/[email protected] | |
with: | |
dotnet-version: '8.0.x' | |
- name: Build | |
run: | | |
cd v2rayN | |
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 | |
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64 | |
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained=true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64 | |
- name: Upload build artifacts | |
uses: actions/[email protected] | |
with: | |
name: v2rayN-linux | |
path: | | |
${{ github.workspace }}/v2rayN/Release/linux* | |
# release debian package | |
- name: Package debian | |
if: github.event.inputs.release_tag != '' | |
run: | | |
chmod 755 package-debian.sh | |
./package-debian.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }} | |
./package-debian.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }} | |
- name: Upload deb to release | |
uses: svenstaro/upload-release-action@v2 | |
if: github.event.inputs.release_tag != '' | |
with: | |
file: ${{ github.workspace }}/v2rayN*.deb | |
tag: ${{ github.event.inputs.release_tag }} | |
file_glob: true | |
prerelease: true | |
- name: Package AppImage | |
if: github.event.inputs.release_tag != '' | |
run: | | |
chmod 755 package-appimage.sh | |
./package-appimage.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }} | |
./package-appimage.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }} | |
- name: Upload AppImage to release | |
uses: svenstaro/upload-release-action@v2 | |
if: github.event.inputs.release_tag != '' | |
with: | |
file: ${{ github.workspace }}/v2rayN*.AppImage | |
tag: ${{ github.event.inputs.release_tag }} | |
file_glob: 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 |