-
-
Notifications
You must be signed in to change notification settings - Fork 115
347 lines (289 loc) · 11.3 KB
/
build.yaml
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
on:
workflow_dispatch:
schedule:
- cron: '5 3 * * *'
name: Build TinyTeX Bundles
env:
# for gh usage with external repo
GH_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
# required for GH to run on another repo (-R option)
# https://cli.github.com/manual/gh_help_environment
GH_REPO: rstudio/tinytex-releases
jobs:
new-release:
runs-on: ubuntu-latest
name: Create new daily draft release
outputs:
tag: ${{ steps.draft.outputs.tag }}
draft-tag: ${{ steps.draft.outputs.draft-tag }}
steps:
- name: Create new draft release
id: draft
run: |
tag=daily
url=$(gh release create ${tag} --draft --prerelease --title "TinyTeX daily build" --notes "(WIP) Next daily release")
echo "draft-tag=$(echo $url | grep -o tag/[^/]*$ | cut -c 5-)" >> $GITHUB_OUTPUT
echo "tag=${tag}" >> $GITHUB_OUTPUT
build-windows:
needs: [new-release]
runs-on: windows-latest
name: Build Bundles For Windows
env:
CTAN_REPO: https://ctan.math.illinois.edu/systems/texlive/tlnet
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.19.2'
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true
- name: Install tinytex package and its deps
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::., any::rmarkdown
- name: Update all packages
run: |
try(update.packages(ask = FALSE, checkBuilt = TRUE))
shell: Rscript {0}
- name: Add TinyTeX to PATH
run: |
echo "$APPDATA\TinyTeX\bin\windows" >> $GITHUB_PATH
shell: bash
- name: Build TinyTeX-0.zip
run: |
Rscript "tools/install-windows-base.R" # the infraonly scheme
7z a TinyTeX-0.zip $Env:APPDATA\\TinyTeX
- name: Build TinyTeX-1.zip
run: |
Rscript "tools/install-windows-more.R" # extra packages for compiling R Markdown
7z a TinyTeX-1.zip $Env:APPDATA\\TinyTeX
- name: Build TinyTeX.zip
run: |
Rscript "tools/test-basic.R" # even more LaTeX packages
7z a TinyTeX.zip $Env:APPDATA\\TinyTeX
- name: Build TinyTeX-2 (scheme-full)
run: |
Rscript "tools/build-scheme-full.R"
7z a -sfx TinyTeX-2.exe $Env:APPDATA\\TinyTeX
- name: Test Installation script
env:
TINYTEX_INSTALLER: TinyTeX-0
run: tools\\install-bin-windows.bat
shell: cmd
- name: Upload bundles
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
retry_wait_seconds: 10
command: |
gh release upload ${{needs.new-release.outputs.draft-tag}} TinyTeX-0.zip TinyTeX-1.zip TinyTeX.zip TinyTeX-2.exe --clobber
build-linux:
needs: [new-release]
name: Build Bundles For Linux
runs-on: ubuntu-latest
outputs:
tlmgr-version: ${{ steps.tlmgr-version.outputs.TLMGR_VERSION }}
env:
CTAN_REPO: https://ctan.math.illinois.edu/systems/texlive/tlnet
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.19.2'
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true
- name: Install tinytex package and its deps
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::., any::rmarkdown
- name: Update all packages
run: |
try(update.packages(ask = FALSE, checkBuilt = TRUE))
shell: Rscript {0}
- name: Build TinyTeX-0.zip & install more package
run: |
sed -i 's|# finished base|cp $OLDPWD/install-tl-unx.tar.gz tools/; Rscript tools/clean-tlpdb.R; tar zcf TinyTeX-0.tar.gz -C ~ .TinyTeX|' tools/install-unx.sh
./tools/install-unx.sh
# tlmgr path add will add in this folder which is not on PATH by default
# (can be checked with tlmgr options sys_bin)
echo "$HOME/bin" >> $GITHUB_PATH
ls -lisa "$HOME/bin"
- name: Build TinyTeX-1.zip with new package installed
run: |
Rscript "tools/clean-tlpdb.R"
tar zcf TinyTeX-1.tar.gz -C ~ .TinyTeX
- name: Build TinyTeX.zip
run: |
Rscript "tools/test-basic.R"
tar zcf TinyTeX.tar.gz -C ~ .TinyTeX
- name: Build TinyTeX-2 (scheme-full)
run: |
Rscript "tools/build-scheme-full.R"
tar Jcf TinyTeX-2.tar.gz -C ~ .TinyTeX
- name: Export Regex file
run: |
Rscript "tools/export-regex.R"
tar zcf regex.tar.gz regex.json
- name: Build *nix installer bundle
working-directory: tools
run: |
cp install-base.sh install.sh
echo "tlmgr install $(cat pkgs-custom.txt | tr '\n' ' ')" >> install.sh
tar zcf ../installer-unix.tar.gz install-tl-unx.tar.gz tinytex.profile install.sh
- name: Get Version information for daily build
id: tlmgr-version
run: |
echo "TLMGR_VERSION<<EOFTLMGR" >> $GITHUB_OUTPUT
~/bin/tlmgr version | sed -n '1p;3p' >> $GITHUB_OUTPUT
echo "EOFTLMGR" >> $GITHUB_OUTPUT
- name: Test Installation script
env:
TINYTEX_INSTALLER: TinyTeX-0
run: ./tools/install-bin-unix.sh
- run: ls -lisa
- name: Upload bundles
# this specific action is used at some issues have been observe with gh while uploading assets
# This allows to not fail the workflow on upload, but retry a few time
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
retry_wait_seconds: 10
command: |
gh release upload ${{needs.new-release.outputs.draft-tag}} TinyTeX-0.tar.gz TinyTeX-1.tar.gz TinyTeX.tar.gz TinyTeX-2.tar.gz installer-unix.tar.gz regex.tar.gz --clobber
build-mac:
needs: [new-release]
runs-on: macos-latest
name: Build Bundles For macOS
env:
CTAN_REPO: https://ctan.math.illinois.edu/systems/texlive/tlnet
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Install Pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '2.19.2'
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: release
use-public-rspm: true
- name: Install tinytex package and its deps
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::., any::rmarkdown
- name: Update all packages
run: |
try(update.packages(ask = FALSE, checkBuilt = TRUE))
shell: Rscript {0}
- name: Build TinyTeX-0.zip & install more package
run: |
sed -i '' 's|# finished base|Rscript tools/clean-tlpdb.R; tar zcf TinyTeX-0.tgz -C ~/Library TinyTeX|' tools/install-unx.sh
./tools/install-unx.sh
- name: Build TinyTeX-1.zip with new package installed
run: |
Rscript "tools/clean-tlpdb.R"
tar zcf TinyTeX-1.tgz -C ~/Library TinyTeX
- name: Build TinyTeX.zip
run: |
Rscript "tools/test-basic.R"
tar zcf TinyTeX.tgz -C ~/Library TinyTeX
- name: Build TinyTeX-2 (scheme-full)
run: |
Rscript "tools/build-scheme-full.R"
# this really is the xz format (for smaller archive size) but `tar xf` can recognize it automatically regardless of file extension
tar Jcf TinyTeX-2.tgz -C ~/Library TinyTeX
- name: Test Installation script
env:
TINYTEX_INSTALLER: TinyTeX-0
run: ./tools/install-bin-unix.sh
- run: ls -lisa
- name: Upload bundles
uses: nick-fields/retry@v3
env:
GH_DEBUG: api
with:
timeout_minutes: 10
max_attempts: 5
retry_wait_seconds: 10
command: |
gh release upload ${{needs.new-release.outputs.draft-tag}} TinyTeX-0.tgz TinyTeX-1.tgz TinyTeX.tgz TinyTeX-2.tgz --clobber
tinitex:
needs: [new-release]
name: Get tinitex release
runs-on: ubuntu-latest
steps:
- name: Get tinytex artifacts
run: |
echo ">> Will retrieve artifact from Quarto latexmk workflow"
runId=$(gh run -R quarto-dev/quarto-cli list -w 'Test quarto-latexmk' --json 'headBranch,conclusion,databaseId' --jq 'map(select(.conclusion == "success" and .headBranch == "main")) | .[0].databaseId')
gh run -R quarto-dev/quarto-cli download $runId --name tinitex --dir tinitex
shell: bash
- name: Repackage in per OS bundle
working-directory: tinitex
run: |
7z a -o.. tinitex.zip x86_64-pc-windows-msvc/.
7z a -ttar -so tinitex.tar aarch64-apple-darwin/. | 7z a -si -o.. tinitex.tgz
7z a -ttar -so tinitex.tar x86_64-unknown-linux-gnu/. | 7z a -si -o.. tinitex.tar.gz
- run: ls -lisa tinitex
- name: Upload bundles
uses: nick-fields/retry@v3
with:
timeout_minutes: 5
max_attempts: 5
retry_wait_seconds: 10
command: |
cd tinitex/
gh release upload ${{needs.new-release.outputs.draft-tag}} tinitex.zip tinitex.tgz tinitex.tar.gz --clobber
deploy:
needs: [new-release, build-windows, build-linux, build-mac, tinitex]
runs-on: ubuntu-latest
name: Publish new daily release
steps:
- name: Create release note
run: |
echo "This release contains the daily build of TinyTeX ($(date +'%A %B %d %Y %r %Z'))." > notes.md
echo "Please see https://github.com/rstudio/tinytex-releases for more info." >> notes.md
echo "" >> notes.md
echo "## TeX Live version" >> notes.md
echo "" >> notes.md
echo '```' >> notes.md
cat <<EOF >> notes.md
${{ needs.build-linux.outputs.tlmgr-version }}
EOF
echo '```' >> notes.md
- name: Publish new release
run: |
echo "::group::Move tag to last commit on master"
sha=$(gh api repos/{owner}/{repo}/git/ref/heads/master --jq '.object.sha')
gh api repos/{owner}/{repo}/git/refs/tags/daily -f sha=$sha --template 'Tag {{.ref | color "blue"}} moved on commit sha {{.object.sha | color "blue"}}.'
echo -e "\n::endgroup::"
echo "::group::undraft new and delete current release"
old=$(gh release edit ${{needs.new-release.outputs.tag}} --draft=true | grep -o tag/[^/]*$ | cut -c 5-)
gh release edit ${{needs.new-release.outputs.draft-tag}} --draft=false --notes-file notes.md
gh release delete ${old} -y
echo -e "\n::endgroup::"
cleaning:
needs: [new-release, deploy]
if: ${{ failure() || cancelled() }}
runs-on: ubuntu-latest
name: Cleaning step in case of error
steps:
- name: Remove unused daily release
run: |
gh release delete ${{needs.new-release.outputs.draft-tag}} -y