-
-
Notifications
You must be signed in to change notification settings - Fork 99
223 lines (216 loc) · 7.26 KB
/
build.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
name: Build
on: [ push, pull_request ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-ubuntu:
strategy:
matrix:
configuration:
- [ 'dynamic', '' ]
- [ 'system', '--with-system-lua-sources' ]
- [ 'embedded', '--enable-embedded-resources' ]
- [ 'static', '--enable-embedded-resources --disable-shared --enable-static' ]
runs-on: ubuntu-22.04
name: Build Ubuntu ${{ matrix.configuration[0] }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache test fonts
uses: actions/cache@v4
with:
path: |
.fonts
.sources
key: fonts-${{ hashFiles('Makefile-fonts') }}
- name: Cache lua_modules
uses: actions/cache@v4
with:
path: |
lua_modules
key: luarocks-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install fonts-sil-gentiumplus ghostscript graphviz jq libarchive-tools libfontconfig1-dev libharfbuzz-dev libicu-dev libluajit-5.1-dev libpng-dev luajit lua-sec lua-socket lua-zlib-dev luarocks poppler-utils
- name: Setup ‘cargo’
uses: actions-rs/toolchain@v1
- name: Configure
run: |
./bootstrap.sh
./configure \
--enable-developer-mode \
--without-developer-tools \
--disable-font-variations \
--with-manual \
${{ matrix.configuration[1] }}
echo "VERSION=$(./build-aux/git-version-gen .tarball-version)" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc) -Otarget" >> $GITHUB_ENV
echo "CARCH=$(uname -m)" >> $GITHUB_ENV
- name: Make
run: |
make
- name: Package
run: |
make dist
- name: Upload source dist artifact
if: matrix.configuration[0] == 'dynamic' && !startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: sile-${{ env.VERSION }}
path: sile-${{ env.VERSION }}.zip
- name: Append architecture to static binary
if: matrix.configuration[0] == 'static'
run: |
cp sile sile-${{ env.CARCH }}
sha256sum sile-${{ env.CARCH }} | tee -a sile-${{ env.VERSION }}.sha256.txt
- name: Upload static binary artifact
if: matrix.configuration[0] == 'static' && !startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: sile-${{ env.CARCH }}
path: sile-${{ env.CARCH }}
- name: Release
uses: softprops/action-gh-release@v2
if: matrix.configuration[0] == 'static' && github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v')
with:
body_path: sile-${{ env.VERSION }}.md
files: |
sile-${{ env.VERSION }}.pdf
sile-${{ env.VERSION }}.zip
sile-${{ env.VERSION }}.tar.zst
sile-${{ env.CARCH }}
sile-${{ env.VERSION }}.sha256.txt
build-from-dist:
runs-on: ubuntu-22.04
name: Build from source tarball without automake
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache lua_modules
uses: actions/cache@v4
with:
path: |
lua_modules
key: luarocks-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install jq libarchive-tools libfontconfig1-dev libharfbuzz-dev libicu-dev libluajit-5.1-dev libpng-dev luajit lua-sec lua-socket lua-zlib-dev luarocks
- name: Configure
run: |
./bootstrap.sh
./configure \
FCMATCH=true \
PDFINFO=false \
--enable-developer-mode \
--without-developer-tools \
DOCKER=$(which docker) \
--disable-font-variations \
--with-system-lua-sources \
--without-manual
echo "VERSION=$(./build-aux/git-version-gen .tarball-version)" >> $GITHUB_ENV
echo "MAKEFLAGS=-j$(nproc) -Otarget" >> $GITHUB_ENV
- name: Package
run: |
make fake-manual
make distdir
- name: Build from dist tree
run: |
make docker-test-dist
build-macos:
name: Build macOS
runs-on: macos-latest
env:
CFLAGS: "-I/opt/homebrew/include/luajit-2.1 -I/opt/homebrew/include"
OBJCFLAGS: "-I/opt/homebrew/include/luajit-2.1 -I/opt/homebrew/include"
LDFLAGS: "-L/opt/homebrew/lib"
DOCKER: false
LDOC: false
NIX: false
SHA256SUM: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache test fonts
uses: actions/cache@v4
with:
path: |
.fonts
.sources
key: fonts-${{ hashFiles('Makefile-fonts') }}
- name: Cache lua_modules
uses: actions/cache@v4
with:
path: |
lua_modules
key: luarocks-${{ hashFiles('Makefile-luarocks', 'sile.rockspec.in') }}
- name: Install system dependencies
run: |
brew install \
autoconf \
automake \
expat \
ghostscript \
graphviz \
libtool \
luajit \
luarocks \
poppler \
rust \
unzip \
zlib
brew link icu4c@76 --force
brew link zlib --force
brew link expat --force
brew install --cask font-gentium-plus
- name: Configure
run: |
./bootstrap.sh
./configure \
--enable-developer-mode \
--without-developer-tools \
--with-system-lua-sources \
--with-manual
echo "VERSION=$(./build-aux/git-version-gen .tarball-version)" >> $GITHUB_ENV
# Note don't use -Otarget for macOS, Homebrew's old make is too buggy
echo "MAKEFLAGS=-j$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
- name: Make
run: |
make
build-nix:
runs-on: ubuntu-22.04
name: Build Nix
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache test fonts
uses: actions/cache@v4
with:
path: |
.fonts
.sources
key: fonts-${{ hashFiles('Makefile-fonts') }}
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v16
- name: Cache Nix dependencies
uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Setup developer environment
run: |
nix develop --command ./bootstrap.sh
nix develop --configure
nix develop --command make
- name: Run regression tests for which Ubuntu can't provide deps
run: |
nix develop --command make regressions TESTSRCS='tests/variations-axis.sil tests/feat-unicode-softhyphen.sil'