mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-01 18:15:00 +03:00
78b0b2224b
* Protect models * Json Context * YAML AOT-friendly optimization * Run the Test in AOT mode * Remove TaskScheduler * Clean build output * Workflows
121 lines
3.4 KiB
YAML
121 lines
3.4 KiB
YAML
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
|
|
isAot:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
secrets:
|
|
GPG_PRIVATE_KEY:
|
|
required: true
|
|
|
|
permissions:
|
|
contents: write
|
|
actions: read
|
|
|
|
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@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: ${{ steps.package-vars.outputs.build_artifact_name }}
|
|
path: ${{ steps.package-vars.outputs.package_dir }}
|
|
|
|
- name: Get v2rayN-core-bin
|
|
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
|
|
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: Upload zip artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: release-${{ inputs.target }}-${{ matrix.arch }}${{ inputs.isAot && '-aot' || '' }}
|
|
path: ${{ steps.package-vars.outputs.final_package_file }}
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
name: sign and upload zip x64 arm64
|
|
needs: package
|
|
strategy:
|
|
matrix:
|
|
arch: [ x64, arm64 ]
|
|
uses: ./.github/workflows/upload-sign.yml
|
|
with:
|
|
release_tag: ${{ inputs.release_tag }}
|
|
artifact_name: release-${{ inputs.target }}-${{ matrix.arch }}${{ inputs.isAot && '-aot' || '' }}
|
|
file_pattern: '*.zip'
|
|
secrets:
|
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|