-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (133 loc) · 4.2 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
name: Build Documentation
on:
workflow_dispatch:
push:
permissions:
contents: write
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Log Disk Space
run: df -h
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
swap-storage: false
- name: Install Dependencies
run: |
sudo apt install ffmpeg pngquant imagemagick libfuse2
wget https://github.com/vgmstream/vgmstream-releases/releases/download/nightly/vgmstream-linux-cli.tar.gz
tar -zxf vgmstream-linux-cli.tar.gz
mkdir bin
mv vgmstream-cli bin
wget https://imagemagick.org/archive/binaries/magick
mv magick bin
chmod a+x bin/*
echo "${PWD}/bin" >> $GITHUB_PATH
- name: Restore Cached Resources
id: restore-gf-downloader-resources
uses: actions/cache/restore@v4
with:
path: |
unpack/downloader/output
key: gf-downloader-resources
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
- name: Setup Python Environment
run: |
cd unpack
pdm install
source .venv/bin/activate
pip install -r downloader/requirements.txt
- name: Download Resources
run: |
cd unpack
source .venv/bin/activate
mkdir -p downloader/resdata
cp gf-data-ch/resdata_no_hash.json downloader/resdata/ch_resdata.json
cd downloader
git apply ../downloader.patch
zip -j resdata.zip resdata/ch_resdata.json
python downloader.py --downloadres 0 --abname
- name: Cache Downloaded Resources
uses: actions/cache/save@v4
with:
path: |
unpack/downloader/output
key: ${{ steps.restore-gf-downloader-resources.outputs.cache-primary-key }}
- name: Restore Cached Resources (images)
id: restore-image-resources
uses: actions/cache/restore@v4
with:
path: |
unpack/images
key: gf-image-resources
- name: Unpack images
run: |
cd unpack
source .venv/bin/activate
python tests/test_backgrounds.py
python tests/test_characters.py
- name: Cache Resources (images)
uses: actions/cache/save@v4
with:
path: |
unpack/images
key: ${{ steps.restore-image-resources.outputs.cache-primary-key }}
- name: Restore Cached Resources (audio)
id: restore-audio-resources
uses: actions/cache/restore@v4
with:
path: |
unpack/audio
key: gf-audio-resources
- name: Unpack audio
run: |
cd unpack
source .venv/bin/activate
python tests/test_audio.py
- name: Cache Resources (audio)
uses: actions/cache/save@v4
with:
path: |
unpack/audio
key: ${{ steps.restore-audio-resources.outputs.cache-primary-key }}
- name: Unpack resources
run: |
cd unpack
source .venv/bin/activate
python -m gfunpack downloader/output -o .
- name: Log Disk Space
run: df -h
- name: Move Resources
run: |
cd unpack
cp audio/audio.json images/backgrounds.json images/characters.json stories/stories.json stories/chapters.json ../src/assets
mv audio ../public
mv images ../public
mv stories ../public
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 9.4.0
run_install: false
- name: Setup PNPM Workspace
run: |
pnpm install
- name: Build Site
run: |
pnpm build-index
pnpm build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: dist