-
Notifications
You must be signed in to change notification settings - Fork 64
155 lines (134 loc) · 4.77 KB
/
linux-precompile.yml
File metadata and controls
155 lines (134 loc) · 4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: linux-precompile
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
armv7l-linux-gnueabihf:
runs-on: ubuntu-latest
container: ubuntu:22.04
env:
ImageOS: ubuntu22
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
DEBIAN_FRONTEND: noninteractive
ARCH: armv7l
TARGET: armv7l-linux-gnueabihf
strategy:
matrix:
job:
- {otp: "27.1.1", elixir: "1.17"}
- {otp: "25.3.2.14", elixir: "1.16"}
name: Linux armv7l - OTP ${{ matrix.job.otp }} - Elixir ${{ matrix.job.elixir }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependecies
run: |
alias sudo=`which sudo`
$sudo apt-get update
$sudo apt-get install -y \
build-essential automake autoconf pkg-config wget curl \
bc m4 unzip zip gcc g++ ca-certificates libssl-dev
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.job.otp }}
elixir-version: ${{ matrix.job.elixir }}
- name: Install armv7l specific deps
run: |
alias sudo=`which sudo`
$sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
- name: Create precompiled ${{ env.ARCH }} library
run: |
ROOTDIR="$(pwd)"
OTP_ROOTDIR="${ROOTDIR}/.tools/otp"
mkdir -p "${OTP_ROOTDIR}"
cd "${OTP_ROOTDIR}"
curl -fSL "https://github.com/cocoa-xu/otp-build/releases/download/v${{ matrix.job.otp }}/otp-${{ env.TARGET }}.tar.gz" -o "otp-${{ env.TARGET }}.tar.gz"
tar -xzf "otp-${{ env.TARGET }}.tar.gz"
cd "${ROOTDIR}"
export PRECOMPILE_ERL_EI_INCLUDE_DIR="${OTP_ROOTDIR}/usr/local/lib/erlang/usr/include"
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix deps.get
mix elixir_make.precompile
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
cache/*${{ env.TARGET }}*.tar.gz
precompile:
runs-on: ubuntu-latest
container: ubuntu:22.04
env:
ImageOS: ubuntu22
LANG: en_US.UTF-8
LANGUAGE: en_US:en
LC_ALL: en_US.UTF-8
DEBIAN_FRONTEND: noninteractive
MIX_ENV: prod
strategy:
matrix:
arch:
- x86_64
- aarch64
- riscv64
job:
- {otp: "27", elixir: "1.17"}
- {otp: "25", elixir: "1.16"}
name: Linux ${{ matrix.arch }} - OTP ${{ matrix.job.otp }} - Elixir ${{ matrix.job.elixir }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install system dependecies
run: |
alias sudo=`which sudo`
$sudo apt-get update
$sudo apt-get install -y \
build-essential automake autoconf pkg-config wget curl \
bc m4 unzip zip gcc g++ ca-certificates libssl-dev
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.job.otp }}
elixir-version: ${{ matrix.job.elixir }}
- name: Install x86_64 specific deps
if: matrix.arch == 'x86_64'
run: |
alias sudo=`which sudo`
$sudo apt-get install -y gcc-i686-linux-gnu g++-i686-linux-gnu \
gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu \
gcc-s390x-linux-gnu g++-s390x-linux-gnu
- name: Install aarch64 specific deps
if: matrix.arch == 'aarch64'
run: |
alias sudo=`which sudo`
$sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Install riscv64 specific deps
if: matrix.arch == 'riscv64'
run: |
alias sudo=`which sudo`
$sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- name: Get musl ${{ matrix.arch }} cross-compilers
run: |
wget "https://musl.cc.timfish.dev/${{matrix.arch}}-linux-musl-cross.tgz" -O "${{matrix.arch}}-linux-musl-cross.tgz"
tar -xf "${{matrix.arch}}-linux-musl-cross.tgz"
- name: Create precompiled ${{ matrix.arch }} library
run: |
export PATH="$(pwd)/${{ matrix.arch }}-linux-musl-cross/bin:${PATH}"
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix deps.get
mix elixir_make.precompile
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.arch == 'x86_64'
with:
files: |
cache/*.tar.gz
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.arch != 'x86_64'
with:
files: |
cache/*${{ matrix.arch }}*.tar.gz