-
Notifications
You must be signed in to change notification settings - Fork 31
132 lines (110 loc) · 3.65 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
---
on:
push:
paths-ignore:
- 'tests/**'
- '*.md'
pull_request:
paths-ignore:
- 'tests/**'
- '*.md'
name: Build
jobs:
build_windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10.4'
architecture: 'x64'
- uses: syphar/restore-virtualenv@v1
id: cache-virtualenv
with:
requirement_files: requirements.txt
- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
- run: pip install -r requirements.txt
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
- name: Install Ninja
run: choco install -y ninja
- name: Extract tooling
env:
TOOLS_URL: 'https://www.dropbox.com/s/4b0hwciadfk8yuo/tools.zip?dl=1'
run: |
# Download tooling
Invoke-WebRequest "$Env:TOOLS_URL" -OutFile .\tools.zip
$hash = (Get-FileHash '.\tools.zip').Hash
if ($hash -ne '40cbee5ce207d8ca71b6611f8f7560e6f135562c25e8fa303f916011e99517ca')
{
echo "Invalid hash: $hash"
exit 1
}
# Extract
Expand-Archive tools.zip
# Fix paths (tools/tools => tools)
Move-Item '.\tools' '.\tools2'
Move-Item '.\tools2\tools' '.\tools'
# Move blobs
Move-Item '.\tools\blobs\main.dol' '.\artifacts\orig\pal\main.dol'
Move-Item '.\tools\blobs\StaticR.rel' '.\artifacts\orig\pal\StaticR.rel'
# Clean up
Remove-Item '.\tools.zip'
Remove-Item -LiteralPath 'tools2' -Force -Recurse
- name: Configure mkw
shell: bash
run: python configure.py --regen_asm
- name: Build mkw
shell: bash
run: ninja
- name: Get DOL progress
run: python -m mkwutil.progress.percent_decompiled --short --part DOL > badge_dol_progress.txt
- uses: actions/upload-artifact@v3
with:
name: badge_dol_progress
path: badge_dol_progress.txt
- name: Get REL progress
run: python -m mkwutil.progress.percent_decompiled --short --part REL > badge_rel_progress.txt
- uses: actions/upload-artifact@v3
with:
name: badge_rel_progress
path: badge_rel_progress.txt
- name: Make docs folder
run: md out/website -ea 0
- name: Run graphic.py
run: python -m mkwutil.progress.graphic --silent
- name: Upload Website Artifacts
uses: actions/upload-artifact@v3
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
with:
name: website
path: out/website
- name: Lint inline ASM
run: python -m mkwutil.tools.lint_inline_asm --pretty ./source/**/*.c*
publish:
runs-on: ubuntu-latest
needs: build_windows
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- name: Download Website Artifacts
uses: actions/download-artifact@v3
with:
name: website
path: out/website
- name: Create doxygen dir
run: mkdir -p out/website/docs
- uses: mattnotmitt/doxygen-action@v1
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: out/website/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2