diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index 79b825da9..df44b5345 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -4,11 +4,16 @@ on: workflow_call: inputs: version: - required: false + required: true description: "The Ark version" - default: ${{ github.sha }} type: string workflow_dispatch: + inputs: + version: + required: false + description: "The Ark version" + default: dev + type: string jobs: # Build ARK for macOS. Both arm64 (Apple Silicon) and x64 (Intel) hosts. @@ -23,7 +28,7 @@ jobs: strategy: matrix: arch: [arm64, x64] - flavor: [debug, release] + flavor: [release, debug] include: - arch: arm64 arch_terminal: arm64 @@ -53,12 +58,6 @@ jobs: - name: Checkout sources uses: actions/checkout@v4 - - name: Install zeromq dependencies - id: install_zeromq_dependencies - run: | - arch -${{matrix.arch_terminal}} /bin/bash -c "${{matrix.homebrew_folder}}/bin/brew install pkg-config" - arch -${{matrix.arch_terminal}} /bin/bash -c "${{matrix.homebrew_folder}}/bin/brew install libsodium" - # Zeromq calls whatever pkg-config version is findable on the PATH to be able to locate # libsodium, so we have to ensure the x86_64 version is first on the PATH when compiling for # that architecture, so that it finds the x86_64 version of libsodium for zeromq to link against. @@ -87,7 +86,7 @@ jobs: pushd target/${{ matrix.rust_target_prefix }}-apple-darwin/${{ matrix.flavor }} # Compress the kernel to an archive - ARCHIVE="$GITHUB_WORKSPACE/ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-darwin-${{ matrix.arch }}.zip" + ARCHIVE="$GITHUB_WORKSPACE/ark-${{ inputs.version }}-${{ matrix.flavor }}-darwin-${{ matrix.arch }}.zip" zip -Xry $ARCHIVE ark popd @@ -97,4 +96,66 @@ jobs: uses: actions/upload-artifact@v4 with: name: ark-${{ matrix.flavor }}-darwin-${{ matrix.arch }}-archive - path: ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-darwin-${{ matrix.arch }}.zip + path: ark-${{ inputs.version }}-${{ matrix.flavor }}-darwin-${{ matrix.arch }}.zip + + + build_universal: + name: Build macOS universal binary + runs-on: macos-latest + timeout-minutes: 40 + needs: build_macos + + env: + DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }} + + strategy: + matrix: + flavor: [release, debug] + + steps: + - name: Checkout sources to get copies of LICENSE and NOTICE + uses: actions/checkout@v4 + with: + sparse-checkout: | + LICENSE + crates/ark/NOTICE + + - name: Download macOS arm64 kernel (${{ matrix.flavor }}) + uses: actions/download-artifact@v4 + with: + name: ark-${{ matrix.flavor }}-darwin-arm64-archive + + - name: Download macOS x64 kernel (${{ matrix.flavor}}) + uses: actions/download-artifact@v4 + with: + name: ark-${{ matrix.flavor }}-darwin-x64-archive + + # Combine macOS binaries to a single binary with lipo + - name: Create macOS universal binary + run: | + # Decompress x64 builds + rm -rf x64 && mkdir x64 + pushd x64 + unzip ../ark-${{ inputs.version }}-${{ matrix.flavor }}-darwin-x64.zip + popd + + # Decompress arm64 build + rm -rf arm64 && mkdir arm64 + pushd arm64 + unzip ../ark-${{ inputs.version }}-${{ matrix.flavor }}-darwin-arm64.zip + popd + + # Create a universal binary + lipo -create x64/ark arm64/ark -output ark + + # Compress and bundle licenses + ARCHIVE="$GITHUB_WORKSPACE/ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-darwin-universal.zip" + [ -e LICENSE ] || cp "$GITHUB_WORKSPACE/LICENSE" LICENSE + [ -e NOTICE ] || cp "$GITHUB_WORKSPACE/crates/ark/NOTICE" NOTICE + zip -Xry $ARCHIVE ark LICENSE NOTICE + + - name: Upload client archive + uses: actions/upload-artifact@v4 + with: + name: ark-${{ matrix.flavor }}-darwin-universal-archive + path: ark-${{ inputs.version }}${{ env.DEBUG_FLAG }}-darwin-universal.zip diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml index e34b3a417..127a708d6 100644 --- a/.github/workflows/release-windows.yml +++ b/.github/workflows/release-windows.yml @@ -46,7 +46,7 @@ jobs: # Compress the kernel to an archive $params = @{ Path = "target\${{ matrix.rust_target_prefix }}-pc-windows-msvc\${{ matrix.flavor }}\ark.exe", "LICENSE", "crates\ark\NOTICE" - DestinationPath = "ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-windows-${{ matrix.arch }}.zip" + DestinationPath = "ark-${{ inputs.version }}-${{ matrix.flavor }}-windows-${{ matrix.arch }}.zip" } Compress-Archive @params @@ -54,4 +54,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: ark-${{ matrix.flavor }}-windows-${{ matrix.arch }}-archive - path: ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-windows-${{ matrix.arch }}.zip + path: ark-${{ inputs.version }}-${{ matrix.flavor }}-windows-${{ matrix.arch }}.zip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1011fe312..04cf57cca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,15 +114,10 @@ jobs: steps: # Download all binaries - - name: Download macOS arm64 kernel (${{ matrix.flavor }}) + - name: Download macOS universal kernel (${{ matrix.flavor}}) uses: actions/download-artifact@v4 with: - name: ark-${{ matrix.flavor }}-darwin-arm64-archive - - - name: Download macOS x64 kernel (${{ matrix.flavor}}) - uses: actions/download-artifact@v4 - with: - name: ark-${{ matrix.flavor }}-darwin-x64-archive + name: ark-${{ matrix.flavor }}-darwin-universal-archive - name: Download Windows x64 kernel (${{ matrix.flavor}}) uses: actions/download-artifact@v4 @@ -134,29 +129,6 @@ jobs: with: name: ark-${{ matrix.flavor }}-linux-x64-archive - - # Combine macOS binaries to a single binary with lipo - - name: Create macOS universal binary - run: | - # Decompress x64 builds - rm -rf x64 && mkdir x64 && pushd x64 - unzip ../ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-darwin-x64.zip - popd - - # Decompress arm64 build - rm -rf arm64 && mkdir arm64 && pushd arm64 - unzip ../ark-${{ needs.get_version.outputs.ARK_VERSION }}-${{ matrix.flavor }}-darwin-arm64.zip - popd - - # Create a universal binary - lipo -create x64/ark arm64/ark -output ark - - # Compress and bundle licenses - ARCHIVE="$GITHUB_WORKSPACE/ark-${{ needs.get_version.outputs.ARK_VERSION }}${{ env.DEBUG_FLAG }}-darwin-universal.zip" - [ -e LICENSE ] || cp "$GITHUB_WORKSPACE/LICENSE" LICENSE - [ -e NOTICE ] || cp "$GITHUB_WORKSPACE/crates/ark/NOTICE" NOTICE - zip -Xry $ARCHIVE ark LICENSE NOTICE - - name: Upload macOS release artifact (universal) uses: actions/upload-release-asset@v1 env: