-
Notifications
You must be signed in to change notification settings - Fork 31
275 lines (243 loc) · 9.42 KB
/
binaries.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
name: "Build binaries"
on: ["push", "pull_request"]
env:
OTP_GITHUB_URL: https://github.com/erlang/otp.git
OTP_VERSION: OTP-24.3.4.15
WXWIDGETS_REPO: https://github.com/wxWidgets/wxWidgets.git
WXWIDGETS_VERSION: master
ELIXIR_VERSION: 1.14.5
ELIXIR_VARIANT: -otp-24
DOCKER_BUILDKIT: 0
jobs:
windows:
runs-on: windows-latest
timeout-minutes: 90
defaults:
run:
shell: wsl-bash {0}
name: Build Erlang/OTP (Windows)
steps:
- name: Restore Windows Cache
uses: actions/cache/restore@v3
id: win32-cache
with:
path: "c:\\opt\\otp.exe"
key: win32-wxwidgets-${{ env.WXWIDGETS_VERSION }}-otp-${{ env.OTP_VERSION }}
- uses: Vampire/setup-wsl@v2
if: steps.win32-cache.outputs.cache-hit != 'true'
with:
distribution: Ubuntu-18.04
- name: Install WSL dependencies
if: steps.win32-cache.outputs.cache-hit != 'true'
run: apt update && apt install -y g++-mingw-w64 gcc-mingw-w64 make autoconf unzip
- name: Install openssl
if: steps.win32-cache.outputs.cache-hit != 'true'
shell: cmd
run: |
choco install openssl --version=1.1.1.2100
IF EXIST "c:\\Program Files\\OpenSSL-Win64" (move "c:\\Program Files\\OpenSSL-Win64" "c:\\OpenSSL-Win64") ELSE (move "c:\\Program Files\\OpenSSL" "c:\\OpenSSL-Win64")
- name: Download wxWidgets
if: steps.win32-cache.outputs.cache-hit != 'true'
run: |
git clone ${{ env.WXWIDGETS_REPO }}
cd wxWidgets
git checkout ${{ env.WXWIDGETS_VERSION }}
git submodule update --init
sed -i -r -e 's/wxUSE_POSTSCRIPT +0/wxUSE_POSTSCRIPT 1/' include/wx/msw/setup.h
sed -i -r -e 's/wxUSE_WEBVIEW_EDGE +0/wxUSE_WEBVIEW_EDGE 1/' include/wx/msw/setup.h
sed -i -r -e 's/WXWIN_COMPATIBILITY_3_0 +0/WXWIN_COMPATIBILITY_3_0 1/' include/wx/msw/setup.h
- name: Install WebView2
if: steps.win32-cache.outputs.cache-hit != 'true'
shell: cmd
run: |
cd wxWidgets\\3rdparty
nuget install Microsoft.Web.WebView2 -Version 1.0.864.35 -Source https://api.nuget.org/v3/index.json
rename Microsoft.Web.WebView2.1.0.864.35 webview2
- name: Build wxWidgets
if: steps.win32-cache.outputs.cache-hit != 'true'
shell: cmd
run: |
cd wxWidgets\\build\\msw
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\Auxiliary\\Build\\vcvars64.bat"
nmake TARGET_CPU=amd64 BUILD=release SHARED=0 DIR_SUFFIX_CPU= -f makefile.vc
- name: Copy wxWidgets
if: steps.win32-cache.outputs.cache-hit != 'true'
run: |
mkdir -p /mnt/c/opt/local64/pgm/
cp -R wxWidgets /mnt/c/opt/local64/pgm/wxWidgets-3.x.x
- name: Compile Erlang
if: steps.win32-cache.outputs.cache-hit != 'true'
run: |
git clone ${{ env.OTP_GITHUB_URL }}
cd otp
git checkout ${{ env.OTP_VERSION }}
export ERL_TOP=`pwd`
export MAKEFLAGS=-j$(($(nproc) + 2))
export ERLC_USE_SERVER=true
export ERTS_SKIP_DEPEND=true
eval `./otp_build env_win32 x64`
./otp_build all -a
cp /mnt/c/opt/local64/pgm/wxWidgets-3.x.x/3rdparty/webview2/runtimes/win-x64/native/WebView2Loader.dll $ERL_TOP/release/win32/erts-*/bin/
./otp_build installer_win32
export NAME=`ls release/win32/otp*.exe`
cp $NAME /mnt/c/opt/otp.exe
- name: Save Windows Cache
if: steps.win32-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: "c:\\opt\\otp.exe"
key: win32-wxwidgets-${{ env.WXWIDGETS_VERSION }}-otp-${{ env.OTP_VERSION }}
- name: Run Erlang installer
shell: cmd
run: C:\\opt\\otp.exe /S
- name: "Install msys2"
uses: msys2/setup-msys2@v2
with:
install: pacman-mirrors pkg-config base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-go upx mingw-w64-x86_64-dlfcn unzip git tar mingw-w64-x86_64-nodejs mingw-w64-x86_64-imagemagick mingw-w64-x86_64-osslsigncode autoconf automake libtool gettext-devel gettext
update: false
release: false
- name: Locate Erlang
shell: msys2 {0}
run: |
ERTS=`find /c/Program\ Files/[Ee]rl* -type d -name "erts-*" -not -path "*lib*"`
echo $ERTS
echo export PATH=\"\$PATH:$ERTS/bin\" > $HOME/.bashrc
- name: Locate NSIS
shell: msys2 {0}
run: |
echo export PATH=\"\$PATH:/c/Program\ Files\ \(x86\)/NSIS\" >> $HOME/.bashrc
- name: Install Elixir
shell: msys2 {0}
run: |
cd $HOME
git clone https://github.com/elixir-lang/elixir.git
cd elixir
git checkout v${{ env.ELIXIR_VERSION }}
make
echo export PATH=\"\$PATH:$HOME/elixir/bin\" >> $HOME/.bashrc
- uses: actions/checkout@v1
- name: "Get dependencies"
shell: msys2 {0}
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get
- name: "npm install"
shell: msys2 {0}
run: |
cd assets && npm install
- name: "Build Release"
env:
MAKE: make
REBAR_TARGET_ARCH_WORDSIZE: 64
REBAR_TARGET_ARCH: x86_64-w64-mingw32
WIN32_KEY_PASS: ${{ secrets.WIN32_KEY_PASS }}
shell: msys2 {0}
run: |
mix assets.deploy
mix desktop.installer
- name: Archive Installer
uses: actions/upload-artifact@v2
with:
name: Windows-Installer
path: |
_build/prod/*.exe
macos:
runs-on: macos-11
steps:
- name: macOS Cache
uses: actions/cache@v3
id: macos-cache
with:
path: /Users/runner/.asdf
key: macos-wxwidgets-${{ env.WXWIDGETS_VERSION }}-otp-${{ env.OTP_VERSION }}
- name: "Install brew deps"
if: steps.macos-cache.outputs.cache-hit != 'true'
run: |
brew install binutils coreutils wget automake autoconf libtool
- name: "Installing wxWidgets"
if: steps.macos-cache.outputs.cache-hit != 'true'
run: |
mkdir ~/projects && cd ~/projects
git clone ${{ env.WXWIDGETS_REPO }}
cd wxWidgets;
git checkout ${{ env.WXWIDGETS_VERSION }}
git submodule update --init
./configure --prefix=/usr/local/wxWidgets --enable-webview --enable-compat30 --disable-shared
make -j8
- name: "Installing Erlang"
if: steps.macos-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
. $HOME/.asdf/asdf.sh
asdf plugin add erlang
asdf plugin add elixir
asdf plugin add nodejs
echo "erlang ref:${{ env.OTP_VERSION }}" >> .tool-versions
echo "elixir ${{ env.ELIXIR_VERSION }}${{ env.ELIXIR_VARIANT }}" >> .tool-versions
echo "nodejs v18.7.0" >> .tool-versions
export KERL_CONFIGURE_OPTIONS="--enable-parallel-configure --with-wxdir=`echo ~/projects/wxWidgets` --disable-jit --without-javac --disable-debug CXX='gcc -std=c++11'"
asdf install
- uses: actions/checkout@v1
- name: "Compile and Lint"
run: |
. $HOME/.asdf/asdf.sh
echo "erlang ref:${{ env.OTP_VERSION }}" > .tool-versions
echo "elixir ${{ env.ELIXIR_VERSION }}${{ env.ELIXIR_VARIANT }}" >> .tool-versions
echo "nodejs v18.7.0" >> .tool-versions
asdf install
mix local.hex --force
mix local.rebar --force
mix deps.get
cd assets && npm install
- name: "Build Release"
env:
MACOS_PEM: ${{ secrets.MACOS_PEM }}
run: |
. $HOME/.asdf/asdf.sh
mix desktop.create_keychain maybe
export MACOS_KEYCHAIN="$HOME/Library/Keychains/macos-build.keychain"
export LD_LIBRARY_PATH="$HOME/projects/wxWidgets/lib/"
mix assets.deploy
mix desktop.installer
- name: Archive MacOS Installer
uses: actions/upload-artifact@v2
with:
name: MacOS-Installer
path: |
_build/prod/*.dmg
linux-x86:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: whoan/docker-build-with-cache-action@master
id: docker
with:
username: ${{ github.actor }}
password: "${{ secrets.GITHUB_TOKEN }}" # you don't need to manually set this secret. GitHub does it on your behalf
registry: docker.pkg.github.com
image_name: linux_installer
dockerfile: scripts/Dockerfile
build_extra_args: |
--build-arg=BASE_IMAGE=ubuntu:18.04
--platform=linux/amd64
--build-arg=PLATFORM=amd64
--build-arg=WXWIDGETS_REPO=${{ env.WXWIDGETS_REPO }}
--build-arg=WXWIDGETS_VERSION=${{ env.WXWIDGETS_VERSION }}
--build-arg=OTP_VERSION=${{ env.OTP_VERSION }}
--build-arg=OTP_GITHUB_URL=${{ env.OTP_GITHUB_URL }}
--build-arg=ELIXIR_VERSION=${{ env.ELIXIR_VERSION }}
--build-arg=ELIXIR_VARIANT=${{ env.ELIXIR_VARIANT }}
- name: Extract runfile
run: |
NAME=$(docker run --platform=linux/amd64 -i ${{steps.docker.outputs.FULL_IMAGE_NAME}} bash -c 'basename `ls /app/_build/prod/*.run`')
NAME=`echo $NAME | tr -d '\n\r'`
docker run --platform=linux/amd64 -i ${{steps.docker.outputs.FULL_IMAGE_NAME}} bash -c 'xxd /app/_build/prod/*.run' | xxd -r > $NAME
chmod +x $NAME
- name: Archive Installer
uses: actions/upload-artifact@v2
with:
name: Linux-Installer
path: |
./*.run