Repository navigation
66 lines (58 loc) · 2.5 KB
/
Copy pathbuild.yml
File metadata and controls
66 lines (58 loc) · 2.5 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
name: build-and-deploy
run-name: Build the game and save artifact
on:
workflow_dispatch:
push:
branches:
- "main"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Free disk space
# Mathlib's build is several GB and grows with every release, and packaging the game
# needs room for a zip of it too. Remove preinstalled SDKs this job never uses.
run: |
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
df -h /
- uses: leanprover/lean-action@v1
with:
use-github-cache: false
- name: Offline checks (build, axioms, world tree, inventory, shortcuts, translation)
run: bash test/run_checks.sh
- name: Show the check logs on the run page
# Written to the job summary, not uploaded: the Game Server imports a repository's newest
# artifact whatever its name, so the built game must be the only artifact this repo makes.
if: always()
run: |
shopt -s nullglob
for f in test/results/*.log; do
printf '<details><summary>%s</summary>\n\n```text\n' "$f"
cat "$f"
printf '\n```\n</details>\n\n'
done >> "$GITHUB_STEP_SUMMARY"
- name: Make sure the game fits on disk once zipped
# The Mathlib cache download is no longer needed after the build. A zip is never larger
# than what it compresses, so stop here with a clear message rather than in `zip`.
run: |
rm -rf ~/.cache/mathlib
need=$(du -sb --exclude=.git . | cut -f1)
have=$(df -B1 --output=avail . | tail -1)
echo "packaging needs up to $((need / 2**30)) GiB, $((have / 2**30)) GiB free"
if [ "$have" -lt "$need" ]; then
echo "::error::Not enough disk space to package the game: need up to $((need / 2**30)) GiB, have $((have / 2**30)) GiB."
exit 1
fi
- name: compress built game
#run: tar -czvf ../game.tar.gz .
run: zip game.zip * .lake/ .i18n/ -r
- name: upload compressed game folder
uses: actions/upload-artifact@v4
with:
name: build-for-server-import
path: |
game.zip
- name: What next?
run: echo "To export the game to the Game Server, open https://adam.math.hhu.de/import/trigger/${GITHUB_REPOSITORY,,} \n Afterwards, you can play the game at https://adam.math.hhu.de/#/g/${GITHUB_REPOSITORY,,}"