Skip to content

Commit

Permalink
ci: use emqx/setup-otp action on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
id committed Mar 16, 2023
1 parent b93b5a8 commit 5d5f18d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 35 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
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
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5d5f18d

Please sign in to comment.