From acf205d9f42ed4ccfd3b8c538a4d53b9985dce65 Mon Sep 17 00:00:00 2001 From: Julien Elbaz Date: Sat, 3 Feb 2024 08:51:58 +0100 Subject: [PATCH] ci: use the new mac m1 runner --- .github/workflows/build.yml | 15 +++++++++------ .github/workflows/release.yml | 26 +++++++++++++++++++------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd794fd..60c859f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,10 @@ on: jobs: macos: - runs-on: macos-latest + strategy: + matrix: + runner: [macos-latest, macos-14] + runs-on: ${{ matrix.runner }} steps: - name: Checkout repository uses: actions/checkout@v2 @@ -18,15 +21,15 @@ jobs: env: HOMEBREW_NO_INSTALL_UPGRADE: 1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - run: brew update && brew install openssl crystal + run: brew update && brew install crystal || true - name: Build the binary - env: - LLVM_CONFIG: /usr/local/opt/llvm@17/bin/llvm-config - run: shards build crystalline --release --no-debug -Dpreview_mt --stats --progress --ignore-crystal-version + run: | + export LLVM_CONFIG="$(brew --prefix)/opt/llvm@17/bin/llvm-config" + shards build crystalline --release --no-debug -Dpreview_mt --stats --progress --ignore-crystal-version - name: Upload a Build Artifact uses: actions/upload-artifact@v2 with: - name: crystalline_x86_64-apple-darwin + name: crystalline_${{ matrix.runner == 'macos-latest' && 'x86_64' || 'arm64' }}-apple-darwin path: ./bin/crystalline linux: runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69a2a9b..d4b79e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,10 @@ on: jobs: macos: - runs-on: macos-latest + strategy: + matrix: + runner: [macos-latest, macos-14] + runs-on: ${{ matrix.runner }} steps: - name: Checkout repository uses: actions/checkout@v2 @@ -15,17 +18,17 @@ jobs: env: HOMEBREW_NO_INSTALL_UPGRADE: 1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - run: brew update && brew install openssl crystal + run: brew update && brew install crystal || true - name: Install dependencies run: shards install --production --ignore-crystal-version - name: Build the binary - env: - LLVM_CONFIG: /usr/local/opt/llvm@17/bin/llvm-config - run: shards build crystalline --release --no-debug -Dpreview_mt --stats --progress --ignore-crystal-version + run: | + export LLVM_CONFIG="$(brew --prefix)/opt/llvm@17/bin/llvm-config" + shards build crystalline --release --no-debug -Dpreview_mt --stats --progress --ignore-crystal-version - name: Upload a Build Artifact uses: actions/upload-artifact@v2 with: - name: crystalline_x86_64-apple-darwin + name: crystalline_${{ matrix.runner == 'macos-latest' && 'x86_64' || 'arm64' }}-apple-darwin path: ./bin/crystalline linux: runs-on: ubuntu-latest @@ -71,7 +74,7 @@ jobs: asset_path: ./artifacts/crystalline_x86_64-unknown-linux-musl/crystalline.gz asset_name: crystalline_x86_64-unknown-linux-musl.gz asset_content_type: application/gzip - - name: Attach macOS binary + - name: Attach macOS x86_64 binary uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -80,3 +83,12 @@ jobs: asset_path: ./artifacts/crystalline_x86_64-apple-darwin/crystalline.gz asset_name: crystalline_x86_64-apple-darwin.gz asset_content_type: application/gzip + - name: Attach macOS arm64 binary + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./artifacts/crystalline_arm64-apple-darwin/crystalline.gz + asset_name: crystalline_arm64-apple-darwin.gz + asset_content_type: application/gzip