From 0c40bfa842273d734c73095998e387557d813100 Mon Sep 17 00:00:00 2001 From: shinra-electric <50119606+shinra-electric@users.noreply.github.com> Date: Tue, 8 Apr 2025 10:40:15 +0100 Subject: [PATCH 1/3] Update actions to v4 Changes checkout and upload actions to v4 --- .github/workflows/compilation.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index feca3b21..fa7a949a 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 @@ -26,7 +26,7 @@ jobs: run: msbuild.exe cli/maxcso.sln -m -p:Configuration=Release -p:Platform=x64 -p:TrackFileAccess=false - name: Upload build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: maxcso-windows-nonpgo path: maxcso.exe @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build run: | @@ -45,7 +45,7 @@ jobs: tar cv maxcso | gzip -9 > maxcso-macos.tar.gz - name: Upload build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: maxcso-macos path: maxcso-macos.tar.gz @@ -56,7 +56,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup dependencies run: sudo apt-get install libuv1-dev liblz4-dev @@ -67,7 +67,7 @@ jobs: tar cv maxcso | gzip -9 > maxcso-linux.tar.gz - name: Upload build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: maxcso-linux path: maxcso-linux.tar.gz From e1d91041088968be08f9e7a6aeb221e327621bbc Mon Sep 17 00:00:00 2001 From: shinra-electric <50119606+shinra-electric@users.noreply.github.com> Date: Tue, 8 Apr 2025 10:41:52 +0100 Subject: [PATCH 2/3] Add matrix for macOS This produces both x64 and arm64 artifacts --- .github/workflows/compilation.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index fa7a949a..940d0819 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -30,10 +30,17 @@ jobs: with: name: maxcso-windows-nonpgo path: maxcso.exe - - build-macos: - name: macOS build - runs-on: macos-latest + + build-macOS: + name: macOS ${{ matrix.suffix }} build + strategy: + matrix: + include: + - runner: macos-latest + suffix: arm64 + - runner: macos-13 + suffix: x86 + runs-on: ${{ matrix.runner}} steps: - name: Checkout repository @@ -41,14 +48,14 @@ jobs: - name: Build run: | - make -j2 - tar cv maxcso | gzip -9 > maxcso-macos.tar.gz + make -j$(sysctl -n hw.ncpu) + tar cv maxcso | gzip -9 > maxcso-macos-${{ matrix.suffix }}.tar.gz - name: Upload build uses: actions/upload-artifact@v4 with: - name: maxcso-macos - path: maxcso-macos.tar.gz + name: maxcso-macos-${{ matrix.suffix }} + path: maxcso-macos-${{ matrix.suffix }}.tar.gz build-ubuntu: name: Ubuntu build From 5960a8425880adb41b027476327367d338e26a20 Mon Sep 17 00:00:00 2001 From: shinra-electric <50119606+shinra-electric@users.noreply.github.com> Date: Sun, 18 May 2025 12:16:45 +0100 Subject: [PATCH 3/3] Create universal binary for macOS --- .github/workflows/compilation.yml | 62 +++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index 940d0819..346b2a38 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -30,32 +30,72 @@ jobs: with: name: maxcso-windows-nonpgo path: maxcso.exe - + build-macOS: - name: macOS ${{ matrix.suffix }} build + name: macOS build strategy: matrix: include: - - runner: macos-latest - suffix: arm64 - - runner: macos-13 - suffix: x86 + - runner: macos-latest + suffix: arm64 + - runner: macos-13 + suffix: x86 runs-on: ${{ matrix.runner}} - + steps: - name: Checkout repository uses: actions/checkout@v4 - + - name: Build run: | make -j$(sysctl -n hw.ncpu) - tar cv maxcso | gzip -9 > maxcso-macos-${{ matrix.suffix }}.tar.gz + mkdir maxcso-${{ matrix.suffix }} + mv maxcso maxcso-${{ matrix.suffix }}/maxcso + + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: maxcso-macOS-${{ matrix.suffix }} + path: maxcso-${{ matrix.suffix }}/maxcso + make-macOS-univeral-binary: + name: macOS universal binary + needs: build-macOS + runs-on: macos-latest + + steps: + - name: download arm artifact + uses: actions/download-artifact@v4 + with: + name: maxcso-macOS-arm64 + path: maxcso-arm64 + + - name: download x86 artifact + uses: actions/download-artifact@v4 + with: + name: maxcso-macOS-x86 + path: maxcso-x86 + + - name: Create universal binary + run: | + mkdir bin + lipo -output bin/maxcso -create maxcso-arm64/maxcso maxcso-x86/maxcso + mv bin/maxcso maxcso + chmod +rxw maxcso + tar cv maxcso | gzip -9 > maxcso-macOS-Universal.tar.gz + + - name: Delete x86 and arm builds + uses: geekyeggo/delete-artifact@v5 + with: + name: | + maxcso-macOS-x86 + maxcso-macOS-arm64 + - name: Upload build uses: actions/upload-artifact@v4 with: - name: maxcso-macos-${{ matrix.suffix }} - path: maxcso-macos-${{ matrix.suffix }}.tar.gz + name: maxcso-macOS-Universal + path: maxcso-macOS-Universal.tar.gz build-ubuntu: name: Ubuntu build