name: release macOS on: workflow_dispatch: inputs: release_tag: required: false type: string push: branches: - master permissions: contents: write actions: read jobs: 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 }} secrets: inherit dmg: name: package and release macOS dmg if: inputs.release_tag != '' needs: build strategy: matrix: arch: [ x64, arm64 ] runs-on: macos-latest env: Arch: |- ${{ case( matrix.arch == 'x64', '64', matrix.arch ) }} steps: - name: Checkout uses: actions/checkout@v7 - name: Restore build artifacts uses: actions/download-artifact@v8 with: name: ${{ matrix.arch }} path: v2rayN-macos-${{ env.Arch }} - name: Setup create-dmg run: brew install create-dmg - name: Ensure script permissions run: chmod 755 package-osx.sh - name: Package dmg run: ./package-osx.sh macos-$Arch v2rayN-macos-$Arch ${{ inputs.release_tag }} - name: Upload dmg artifact uses: actions/upload-artifact@v7 with: name: release-dmg-${{ matrix.arch }} path: v2rayN*.dmg if-no-files-found: error release-dmg: name: sign and upload macOS dmg if: inputs.release_tag != '' needs: dmg strategy: matrix: arch: [ x64, arm64 ] uses: ./.github/workflows/upload-sign.yml with: release_tag: ${{ inputs.release_tag }} artifact_name: release-dmg-${{ matrix.arch }} file_pattern: '*.dmg' secrets: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}