Skip to content

Commit 6a81e63

Browse files
authored
chore(ci): use installer from elixir-lang.org (#69)
Signed-off-by: Cocoa <i@uwucocoa.moe>
1 parent 9cf150c commit 6a81e63

File tree

2 files changed

+23
-29
lines changed

2 files changed

+23
-29
lines changed

.github/workflows/macos-precompile.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ concurrency:
1313

1414
jobs:
1515
precompile:
16-
runs-on: macos-12
16+
runs-on: macos-13
1717
env:
1818
TFLITE_BEAM_PREFER_PRECOMPILED: "false"
19+
OTP_VERSION: ${{ matrix.pair.otp }}
20+
ELIXIR_VERSION: "1.16.3"
1921
name: ${{ matrix.pair.arch }}-apple-darwin - OTP ${{ matrix.pair.otp }}
2022

2123
strategy:
@@ -39,16 +41,12 @@ jobs:
3941
- name: Checkout
4042
uses: actions/checkout@v4
4143

42-
- name: Install Erlang and Elixir
44+
- name: Install OTP and rebar3
4345
run: |
44-
TRIPLET=x86_64-apple-darwin
45-
export PATH=$(pwd)/cache/otp/usr/local/bin:${PATH}
46-
export ERL_ROOTDIR=$(pwd)/cache/otp/usr/local/lib/erlang
46+
curl -fsSO https://elixir-lang.org/install.sh
47+
sh install.sh "elixir@${ELIXIR_VERSION}" "otp@${OTP_VERSION}"
4748
48-
mkdir -p ./cache/otp
49-
curl -fSL https://github.com/cocoa-xu/otp-build/releases/download/v${{ matrix.pair.otp }}/otp-${TRIPLET}.tar.gz -o ./cache/otp/otp-v${{ matrix.pair.otp }}-${TRIPLET}.tar.gz
50-
cd ./cache/otp
51-
tar -xzf otp-v${{ matrix.pair.otp }}-${TRIPLET}.tar.gz
49+
export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH
5250
5351
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
5452
./rebar3 local install
@@ -60,8 +58,7 @@ jobs:
6058

6159
- name: Create precompiled library
6260
run: |
63-
export PATH="$(pwd)/cache/otp/usr/local/bin:~/.cache/rebar3/bin:${PATH}"
64-
export ERL_ROOTDIR=$(pwd)/cache/otp/usr/local/lib/erlang
61+
export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH
6562
6663
export NIF_VERSION="$(erl -noshell -eval "io:format('~ts', [erlang:system_info(nif_version)])." -s erlang halt)"
6764
if [ "${{ matrix.pair.arch }}" = "aarch64" ]; then

.github/workflows/macos-x86_64.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,38 @@ concurrency:
2828

2929
jobs:
3030
rebar3_compile:
31-
runs-on: macos-12
31+
runs-on: macos-13
3232
env:
3333
TFLITE_BEAM_CORAL_SUPPORT: "true"
3434
TFLITE_BEAM_PREFER_PRECOMPILED: "false"
3535
OTP_VERSION: "26.2.1"
36-
ELIXIR_VERSION: "1.16.0"
36+
ELIXIR_VERSION: "1.16.3"
3737

3838
steps:
39-
- uses: actions/checkout@v4
39+
- name: Checkout
40+
uses: actions/checkout@v4
4041

41-
- name: Install Erlang and Elixir
42+
- name: Install OTP and rebar3
4243
run: |
43-
export HOMEBREW_NO_AUTO_UPDATE=1
44-
brew install autoconf automake coreutils curl git openssl asdf
45-
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
46-
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
47-
export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac"
48-
asdf install erlang "${OTP_VERSION}"
49-
asdf install elixir "${ELIXIR_VERSION}"
50-
asdf global erlang "${OTP_VERSION}"
51-
asdf global elixir "${ELIXIR_VERSION}"
52-
source $(brew --prefix asdf)/libexec/asdf.sh
53-
mix local.hex --force
54-
mix local.rebar --force
44+
curl -fsSO https://elixir-lang.org/install.sh
45+
sh install.sh "elixir@${ELIXIR_VERSION}" "otp@${OTP_VERSION}"
46+
47+
export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH
48+
5549
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
5650
./rebar3 local install
57-
51+
5852
- name: Setup cmake
5953
uses: jwlawson/actions-setup-cmake@v2
6054
with:
6155
cmake-version: '3.22.x'
6256

6357
- name: Compile
6458
run: |
65-
source $(brew --prefix asdf)/libexec/asdf.sh
59+
export OTP_MAIN_VER="${OTP_VERSION%%.*}"
60+
export PATH=$HOME/.elixir-install/installs/otp/${OTP_VERSION}/bin:$PATH
61+
export PATH=$HOME/.elixir-install/installs/elixir/${ELIXIR_VERSION}-otp-${OTP_MAIN_VER}/bin:$PATH
6662
export PATH="~/.cache/rebar3/bin:$PATH"
63+
6764
rebar3 deps
6865
rebar3 compile

0 commit comments

Comments
 (0)