From e92ed055b2fd5812959a0665757f4415301d66ab Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Fri, 30 Aug 2024 13:12:55 +0200 Subject: [PATCH 1/3] Fix version references --- .github/workflows/release-macos.yml | 4 ++-- .github/workflows/release-windows.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index 79b825da9..e314f2b7e 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -87,7 +87,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 +97,4 @@ 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 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 From 7f2269abc27d242052e26ea1c4f022c10f62d0a2 Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Fri, 30 Aug 2024 13:15:21 +0200 Subject: [PATCH 2/3] Remove now unnecessary steps Fix warnings --- .github/workflows/release-macos.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index e314f2b7e..23c442eae 100644 --- a/.github/workflows/release-macos.yml +++ b/.github/workflows/release-macos.yml @@ -53,12 +53,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. From 836b2934ee9fe471b0c3e276c0a4594cc68b1090 Mon Sep 17 00:00:00 2001 From: Lionel Henry Date: Fri, 30 Aug 2024 13:43:11 +0200 Subject: [PATCH 3/3] Create universal binary as part of the macos subjobs And fix issues --- .github/workflows/release-macos.yml | 73 +++++++++++++++++++++++++++-- .github/workflows/release.yml | 32 +------------ 2 files changed, 72 insertions(+), 33 deletions(-) diff --git a/.github/workflows/release-macos.yml b/.github/workflows/release-macos.yml index 23c442eae..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 @@ -92,3 +97,65 @@ jobs: with: name: ark-${{ matrix.flavor }}-darwin-${{ matrix.arch }}-archive 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.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: