From 7362024177110d2cf8e588b1c29310c0a7e0d687 Mon Sep 17 00:00:00 2001 From: zadig Date: Mon, 19 Feb 2024 17:10:58 +0100 Subject: [PATCH] Add macOS support. --- .github/workflows/main.yml | 20 ++++++++++++++++++-- action.yml | 10 +++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9ffa333..35b1502 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,9 @@ on: [push] jobs: - buck2_default_job: + buck2_linux: runs-on: ubuntu-latest - name: A job to try our buck2 composite action + name: A job to try our buck2 composite action on ubuntu. steps: - uses: actions/checkout@v4 - name: Use buck2 composite action @@ -11,3 +11,19 @@ jobs: - name: Verify that buck2 binary is available run: | /usr/bin/buck2 --version + + buck2_macos: + runs-on: macos-13 + name: A job to try our buck2 composite action on macOS. + steps: + - uses: actions/checkout@v4 + - name: Use buck2 composite action + uses: zadlg/buck2-github-composite-action@v3 + with: + arch: x86_64 + platform: apple-darwin + sha384: 230272fa57843a024759187e5606859755250e612a288122ea91ce54f5e602186dfc8cd06c9e895c7d66954b16c9f92 + output-path: /usr/local/bin/buck2 + - name: Verify that buck2 binary is available + run: | + /usr/local/bin/buck2 --version diff --git a/action.yml b/action.yml index 13d00cd..1c7ea0e 100644 --- a/action.yml +++ b/action.yml @@ -30,7 +30,15 @@ runs: steps: - name: Download dependencies shell: bash - run: sudo apt-get update && sudo apt-get install -y curl zstd + run: | + os=$(uname -s) + if [ "${os}" = "Darwin" ]; then + brew update && brew install curl zstd + elif [ "${os}" = "Linux" ]; then + sudo apt-get update && sudo apt-get install -y curl zstd + else + printf "Unsupported OS %s\n" "${os}" + fi - name: Download buck2 binary shell: bash