start macos precompile #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: precompile | |
on: | |
push: | |
branches: | |
- 'precompile-woes' | |
permissions: | |
contents: write | |
jobs: | |
macos-precompile: | |
runs-on: macos-12 | |
env: | |
MIX_ENV: prod | |
strategy: | |
matrix: | |
arch: | |
- x86_64-apple-darwin | |
- aarch64-apple-darwin | |
job: | |
- {otp: "27", elixir: "1.17"} | |
- {otp: "25", elixir: "1.16"} | |
name: Mac ${{ matrix.arch }} - OTP ${{ matrix.job.otp }} - Elixir ${{ matrix.job.elixir }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Erlang and Elixir | |
run: | | |
export ROOT_DIR=$(pwd) | |
export PATH=$(pwd)/cache/otp/usr/local/bin:${PATH} | |
export ERL_ROOTDIR=$(pwd)/cache/otp/usr/local/lib/erlang | |
mkdir -p ./cache/otp | |
curl -fSL https://github.com/cocoa-xu/otp-build/releases/download/v${{ matrix.job.otp }}/otp-${{ matrix.arch }}.tar.gz -o ./cache/otp/otp-v${{ matrix.job.otp }}-${{ matrix.arch }}.tar.gz | |
cd ./cache/otp | |
tar -xzf otp-v${{ matrix.job.otp }}-${{ matrix.arch }}.tar.gz | |
wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3 | |
./rebar3 local install | |
- name: Create precompiled ${{ matrix.arch }} library | |
run: | | |
export PATH=$(pwd)/cache/otp/usr/local/bin:$(pwd)/./cache/elixir/elixir-${{ matrix.job.elixir }}/bin:${PATH} | |
export ERL_ROOTDIR=$(pwd)/cache/otp/usr/local/lib/erlang | |
mkdir -p ./cache/elixir | |
curl -fSL https://github.com/elixir-lang/elixir/archive/refs/tags/v${{ matrix.job.elixir }}.tar.gz -o ./cache/elixir/elixir-${{ matrix.job.elixir }}.tar.gz | |
cd ./cache/elixir | |
tar -xzf elixir-${{ matrix.job.elixir }}.tar.gz | |
cd elixir-${{ matrix.job.elixir }} | |
make compile | |
make -j$(sysctl -n hw.ncpu) install | |
mix local.hex --force | |
mix local.rebar --force |