-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.drone.yml
177 lines (165 loc) · 6.62 KB
/
.drone.yml
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
########################################################################################################
kind: pipeline
type: docker
name: erlang-x86_64
platform:
os: linux
arch: amd64
clone:
disable: true
steps:
- name: build
image: docker.io/alpine:3.18.4
environment:
MUSL_HASH: 17613ec13d9aa9e5e907e6750785c5bbed3ad49472ec12281f592e2f0f2d3dbd
BUNNY_PASSWORD:
from_secret: bunny_password
commands:
- echo $(uname -a)
- echo OPENSSL_VERSION=${OPENSSL_VERSION}
- echo OTP_VERSION=${OTP_VERSION}
- apk update
- apk add automake autoconf gcc curl wget make musl-dev linux-headers patchelf file
- wget https://github.com/erlang/otp/releases/download/OTP-$OTP_VERSION/otp_src_$OTP_VERSION.tar.gz
- wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
- tar xzf otp_src_$OTP_VERSION.tar.gz
- tar xzf openssl-$OPENSSL_VERSION.tar.gz
- mkdir sysroot
# Build OpenSSL
- cd openssl-$OPENSSL_VERSION
- ./config no-asm no-tests no-shared --prefix=$(pwd)/../sysroot
- make -j4 && make install_sw
- cd ..
- ln -s $(pwd)/sysroot/lib64 $(pwd)/sysroot/lib
# Build Erlang
- cd otp_src_$OTP_VERSION
- ./configure --without-javac --without-jinterface --without-wx --without-termcap --without-megaco --with-ssl=$(pwd)/../sysroot --disable-dynamic-ssl-lib
- make -j4
- RELEASE_ROOT="$(pwd)/release/otp_x86_64_linux_${OTP_VERSION}" make release -j
- cd release/otp*
- >-
find . -executable -exec file {} \; | grep -i ELF | grep -i interpreter | cut -d: -f1 | xargs -I '{}' ash -c 'patchelf --set-interpreter /tmp/libc-musl-$${MUSL_HASH}.so {}'
- cd ../
- tar czf otp_${OTP_VERSION}_linux_any_x86_64_ssl_${OPENSSL_VERSION}.tar.gz ./otp*
- >-
curl -X PUT --data-binary "@$(pwd)/otp_${OTP_VERSION}_linux_any_x86_64_ssl_${OPENSSL_VERSION}.tar.gz" -H "AccessKey: $${BUNNY_PASSWORD}" "https://la.storage.bunnycdn.com/otp-universal-store/OTP-${OTP_VERSION}/linux/x86_64/any/otp_${OTP_VERSION}_linux_any_x86_64_ssl_${OPENSSL_VERSION}.tar.gz"
trigger:
event:
exclude:
- cron
- push
- pull_request
- tag
- promote
- rollback
---
########################################################################################################
kind: pipeline
type: docker
name: erlang-arm64
platform:
os: linux
arch: arm64
clone:
disable: true
steps:
- name: build
image: docker.io/alpine:3.18.4
environment:
MUSL_HASH: 939d11dcd3b174a8dee05047f2ae794c5c43af54720c352fa946cd8b0114627a
BUNNY_PASSWORD:
from_secret: bunny_password
commands:
- echo $(uname -a)
- echo OPENSSL_VERSION=${OPENSSL_VERSION}
- echo OTP_VERSION=${OTP_VERSION}
- apk update
- apk add automake autoconf gcc curl wget make musl-dev linux-headers patchelf file
- wget https://github.com/erlang/otp/releases/download/OTP-$OTP_VERSION/otp_src_$OTP_VERSION.tar.gz
- wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
- tar xzf otp_src_$OTP_VERSION.tar.gz
- tar xzf openssl-$OPENSSL_VERSION.tar.gz
- mkdir sysroot
# Build OpenSSL
- cd openssl-$OPENSSL_VERSION
- ./config no-asm no-tests no-shared --prefix=$(pwd)/../sysroot
- make -j4 && make install_sw
- cd ..
# Build Erlang
- cd otp_src_$OTP_VERSION
- ./configure --without-javac --without-jinterface --without-wx --without-termcap --without-megaco --with-ssl=$(pwd)/../sysroot --disable-dynamic-ssl-lib
- make -j4
- RELEASE_ROOT="$(pwd)/release/otp_aarch64_linux_${OTP_VERSION}" make release -j
- cd release/otp*
- >-
find . -executable -exec file {} \; | grep -i ELF | grep -i interpreter | cut -d: -f1 | xargs -I '{}' ash -c 'patchelf --set-interpreter /tmp/libc-musl-$${MUSL_HASH}.so {}'
- cd ../
- tar czf otp_${OTP_VERSION}_linux_any_aarch64_ssl_${OPENSSL_VERSION}.tar.gz ./otp*
- >-
curl -X PUT --data-binary "@$(pwd)/otp_${OTP_VERSION}_linux_any_aarch64_ssl_${OPENSSL_VERSION}.tar.gz" -H "AccessKey: $${BUNNY_PASSWORD}" "https://la.storage.bunnycdn.com/otp-universal-store/OTP-${OTP_VERSION}/linux/aarch64/any/otp_${OTP_VERSION}_linux_any_aarch64_ssl_${OPENSSL_VERSION}.tar.gz"
trigger:
event:
exclude:
- cron
- push
- pull_request
- tag
- promote
- rollback
---
########################################################################################################
kind: pipeline
type: exec
name: erlang-macos
platform:
os: darwin
arch: arm64
clone:
disable: true
steps:
- name: build
environment:
BUNNY_PASSWORD:
from_secret: bunny_password
commands:
- echo $(uname -a)
- echo OPENSSL_VERSION=${OPENSSL_VERSION}
- echo OTP_VERSION=${OTP_VERSION}
- brew update && brew upgrade
- brew install autoconf elixir
- wget https://github.com/erlang/otp/releases/download/OTP-$OTP_VERSION/otp_src_$OTP_VERSION.tar.gz
- wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
- mkdir sysroot
- tar xzf otp_src_$OTP_VERSION.tar.gz
- tar xzf openssl-$OPENSSL_VERSION.tar.gz
# Build OpenSSL
- cd openssl-$OPENSSL_VERSION
- CC="cc -arch x86_64 -arch arm64" ./config no-tests no-shared no-asm --prefix=$(pwd)/../sysroot
- CC="cc -arch x86_64 -arch arm64" make && make install_sw
- cd ..
# Build Erlang (x86_64)
- cd otp_src_$OTP_VERSION
- arch -x86_64 ./configure --without-javac --without-jinterface --without-wx --without-termcap --without-megaco --with-ssl=$(pwd)/../sysroot --disable-dynamic-ssl-lib
- arch -x86_64 make -j4
- arch -x86_64 make release -j
# Build Erlang/OTP (aarch64)
- arch -arm64 ./configure --without-javac --without-jinterface --without-wx --without-termcap --without-megaco --with-ssl=$(pwd)/../sysroot --disable-dynamic-ssl-lib
- arch -arm64 make -j4
- arch -arm64 make release -j
# Combine in universal release
- cd release
- mkdir otp_universal_apple_darwin_$OTP_VERSION
- /Users/jenkins/merge-lipo.pl $(pwd)/x86_64* $(pwd)/aarch64* $(pwd)/otp_universal_apple_darwin_$OTP_VERSION
- cp -r $(pwd)/x86_64*/erts-*/include/ $(pwd)/otp_universal_apple_darwin_$OTP_VERSION/erts-*/
- tar czf otp_${OTP_VERSION}_macos_universal_ssl_${OPENSSL_VERSION}.tar.gz ./otp_universal_apple_darwin_$OTP_VERSION
- >-
curl -X PUT --data-binary "@$(pwd)/otp_${OTP_VERSION}_macos_universal_ssl_${OPENSSL_VERSION}.tar.gz" -H "AccessKey: $${BUNNY_PASSWORD}" "https://la.storage.bunnycdn.com/otp-universal-store/OTP-${OTP_VERSION}/macos/universal/otp_${OTP_VERSION}_macos_universal_ssl_${OPENSSL_VERSION}.tar.gz"
trigger:
event:
exclude:
- cron
- push
- pull_request
- tag
- promote
- rollback