mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-01 18:15:00 +03:00
Native Aot (#10295)
* Protect models * Json Context * YAML AOT-friendly optimization * Run the Test in AOT mode * Remove TaskScheduler * Clean build output * Workflows
This commit is contained in:
@@ -9,6 +9,10 @@ on:
|
||||
target: # windows linux macos windows-desktop
|
||||
required: true
|
||||
type: string
|
||||
isAot:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
secrets:
|
||||
GPG_PRIVATE_KEY:
|
||||
required: true
|
||||
@@ -43,27 +47,62 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Set package variables
|
||||
id: package-vars
|
||||
shell: bash
|
||||
env:
|
||||
INPUT_TARGET: ${{ inputs.target }}
|
||||
INPUT_IS_AOT: ${{ inputs.isAot }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
package_dir="v2rayN-${Target}-${Arch}"
|
||||
package_file="${package_dir}.zip"
|
||||
build_artifact_name="${{ matrix.arch }}"
|
||||
rename_suffix=""
|
||||
if [[ "$INPUT_IS_AOT" == "true" ]]; then
|
||||
build_artifact_name="${build_artifact_name}-aot"
|
||||
rename_suffix="-aot"
|
||||
fi
|
||||
if [[ "$INPUT_TARGET" == "windows-desktop" ]]; then
|
||||
rename_suffix="-desktop${rename_suffix}"
|
||||
fi
|
||||
final_package_file="${package_dir}${rename_suffix}.zip"
|
||||
|
||||
{
|
||||
echo "build_artifact_name=${build_artifact_name}"
|
||||
echo "package_dir=${package_dir}"
|
||||
echo "package_file=${package_file}"
|
||||
echo "final_package_file=${final_package_file}"
|
||||
echo "rename_suffix=${rename_suffix}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Restore build artifacts
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ matrix.arch }}
|
||||
path: v2rayN-${{ env.Target }}-${{ env.Arch }}
|
||||
|
||||
name: ${{ steps.package-vars.outputs.build_artifact_name }}
|
||||
path: ${{ steps.package-vars.outputs.package_dir }}
|
||||
|
||||
- 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"
|
||||
|
||||
run: |
|
||||
wget -nv -O "${{ steps.package-vars.outputs.package_file }}" "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
|
||||
shell: bash
|
||||
run: |
|
||||
7z a -tZip "${{ steps.package-vars.outputs.package_file }}" "${{ steps.package-vars.outputs.package_dir }}" -mx1
|
||||
|
||||
- name: Rename package archive
|
||||
if: steps.package-vars.outputs.rename_suffix != ''
|
||||
shell: bash
|
||||
run: |
|
||||
mv "${{ steps.package-vars.outputs.package_file }}" \
|
||||
"${{ steps.package-vars.outputs.package_dir }}${{ steps.package-vars.outputs.rename_suffix }}.zip"
|
||||
|
||||
- name: Rename windows-desktop
|
||||
if: inputs.target == 'windows-desktop'
|
||||
run: mv "v2rayN-$Target-$Arch.zip" "v2rayN-$Target-$Arch-desktop.zip"
|
||||
|
||||
- name: Upload zip artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: release-${{ inputs.target }}-${{ matrix.arch }}
|
||||
path: v2rayN*.zip
|
||||
name: release-${{ inputs.target }}-${{ matrix.arch }}${{ inputs.isAot && '-aot' || '' }}
|
||||
path: ${{ steps.package-vars.outputs.final_package_file }}
|
||||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
@@ -75,7 +114,7 @@ jobs:
|
||||
uses: ./.github/workflows/upload-sign.yml
|
||||
with:
|
||||
release_tag: ${{ inputs.release_tag }}
|
||||
artifact_name: release-${{ inputs.target }}-${{ matrix.arch }}
|
||||
artifact_name: release-${{ inputs.target }}-${{ matrix.arch }}${{ inputs.isAot && '-aot' || '' }}
|
||||
file_pattern: '*.zip'
|
||||
secrets:
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
|
||||
Reference in New Issue
Block a user