mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 12:35:46 +00:00
98 lines
No EOL
2.6 KiB
YAML
98 lines
No EOL
2.6 KiB
YAML
name: release macOS
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
release_tag:
|
|
required: false
|
|
type: string
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
env:
|
|
OutputArch: "macos-64"
|
|
OutputArchArm: "macos-arm64"
|
|
OutputPath64: "${{ github.workspace }}/v2rayN/Release/macos-x64"
|
|
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/macos-arm64"
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
arch: [ x64, arm64 ]
|
|
uses: ./.github/workflows/build.yml
|
|
with:
|
|
target: macos
|
|
arch: ${{ matrix.arch }}
|
|
|
|
release-zip:
|
|
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-macos-x64
|
|
path: ${{ github.workspace }}/v2rayN/Release
|
|
|
|
- name: Restore build artifacts arm64
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: v2rayN-macos-arm64
|
|
path: ${{ github.workspace }}/v2rayN/Release
|
|
|
|
- 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
|
|
|
|
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 |