From fef210083dbb28bbe4ff0f3b2f879dc6cb7cd434 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Wed, 1 May 2024 06:28:34 +0200 Subject: [PATCH] Add artifacts for Apple Silicon (amd64) --- .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++++---- README.md | 1 + 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5190b19..ae3c273 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,11 +115,6 @@ jobs: build-macos-x86_64: name: Build MacOS (x86_64) - # This is x86-64, M1 not for free - # - # NOTE: on macos-13 it cannot find proper SDK, with the following error: - # - # unable to find suitable Apple SDK supporting macosx11.1 or newer runs-on: macos-12 steps: @@ -169,6 +164,57 @@ jobs: path: | chdig-macos-x86_64.gz + build-macos-arm64: + name: Build MacOS (arm64) + runs-on: macos-14 + + steps: + - uses: actions/checkout@v3 + with: + # To fetch tags, but can this be improved using blobless checkout? + # [1]. But anyway right it is not important, and unlikely will be, + # since the repository is small. + # + # [1]: https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ + fetch-depth: 0 + + # Workaround for https://github.com/actions/checkout/issues/882 + - name: Fix tags for release + # will break on a lightweight tag + run: git fetch origin +refs/tags/*:refs/tags/* + + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + + - name: Worker info + run: | + # SDKs versions + ls -al /Library/Developer/CommandLineTools/SDKs/ + + - name: Install dependencies + run: | + pip3 install PyOxidizer --break-system-packages + + - name: Build + run: | + set -x + make deploy-binary + cp target/chdig chdig-macos-arm64 + gzip --keep chdig-macos-arm64 + + - name: Check package + run: | + ls -al + ./chdig-macos-arm64 --help + + - name: Archive MacOS packages + uses: actions/upload-artifact@v3 + with: + name: macos-packages + path: | + chdig-macos-arm64.gz + build-windows: name: Build Windows runs-on: windows-latest diff --git a/README.md b/README.md index 1020d5a..77500bc 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ There are pre-built packages for the latest available version: - [archlinux](https://github.com/azat/chdig/releases/download/latest/chdig-latest-x86_64.pkg.tar.zst) - [tar.gz](https://github.com/azat/chdig/releases/download/latest/chdig-latest-x86_64.tar.gz) - [macos x86_64](https://github.com/azat/chdig/releases/download/latest/chdig-macos-x86_64.gz) +- [macos arm64](https://github.com/azat/chdig/releases/download/latest/chdig-macos-arm64.gz) - [windows](https://github.com/azat/chdig/releases/download/latest/chdig-windows.exe.zip)