From e33ff71b8ed12312edff10a7e5729238de00151b Mon Sep 17 00:00:00 2001 From: Ivan Dyachkov Date: Thu, 16 Mar 2023 20:23:31 +0100 Subject: [PATCH] ci: use emqx/setup-otp action on macos --- .github/workflows/main.yml | 19 ++++++++----------- .github/workflows/release.yaml | 28 ++++------------------------ 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e9e5d5f6..d37ec087 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,11 +7,13 @@ jobs: fail-fast: false matrix: os: + - macos-12-arm64 - macos-12 - macos-11 otp: - - 24 - - 25 + - 25.1.2-2 + - 24.3.4.2-2 + runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -25,17 +27,12 @@ jobs: ~/Library/Caches/Homebrew/ ~/Library/Caches/Homebrew/downloads/ key: brew-${{ matrix.os }}-${{ matrix.otp }} - - name: prepare - run: | - #brew update - brew install erlang@${{ matrix.otp }} - - name: install rebar3 - run: | - wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 - cp ./rebar3 /usr/local/bin/rebar3 + - uses: emqx/setup-otp@v1.0.0 + with: + os: ${{ matrix.os }} + otp: ${{ matrix.otp }} - name: release build run: | - export PATH="/usr/local/opt/erlang@${{ matrix.otp }}/bin:$PATH" erl -eval 'erlang:display(erlang:system_info(system_version)),halt()' ulimit -c unlimited # run sudo for getting coredump diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4d5f94f3..34bd4c65 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,43 +14,23 @@ jobs: - 25.1.2-2 - 24.3.4.2-2 os: + - macos-12-arm64 - macos-12 - macos-11 runs-on: ${{ matrix.os }} steps: - - name: prepare - run: | - # brew update - brew install curl zip unzip gnu-sed kerl - echo "/usr/local/bin" >> $GITHUB_PATH - git config --global credential.helper store - - uses: actions/cache@v3 - id: cache + - uses: emqx/setup-otp@v1 with: - path: ~/.kerl/${{ matrix.otp }} - key: otp-install-${{ matrix.otp }}-${{ matrix.os }} - - - name: build erlang - if: steps.cache.outputs.cache-hit != 'true' - timeout-minutes: 60 - run: | - kerl update releases - kerl build git https://github.com/emqx/otp.git OTP-${{ matrix.otp }} ${{ matrix.otp }} - kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }} + os: ${{ matrix.os }} + otp: ${{ matrix.otp }} - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: install rebar3 - run: | - wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 - cp ./rebar3 /usr/local/bin/rebar3 - - name: build release if: startsWith(github.ref, 'refs/tags/') run: | - . $HOME/.kerl/${{ matrix.otp }}/activate BUILD_RELEASE=1 make - uses: actions/upload-artifact@v3