-
Notifications
You must be signed in to change notification settings - Fork 4
154 lines (129 loc) · 4.27 KB
/
main.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
name: Build and deploy
on: [push]
jobs:
windows-debug:
runs-on: windows-latest
name: Windows debug build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Builderino
run: |
msbuild /p:Configuration=Debug /p:Platform=x64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: WindowsDebug
path: |
bin/
!bin/*.html
windows-release:
runs-on: windows-latest
name: Windows release build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Builderino
run: |
msbuild /p:Configuration=Release /p:Platform=x64
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: WindowsRelease
path: |
bin/
!bin/*.html
web-release:
runs-on: ubuntu-latest
name: Emscripten release build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find and define GITHUB_REF_SLUG
uses: rlespinasse/github-slug-action@v4
- name: Cache
uses: actions/cache@v3
with:
# use branch name for cache invalidation (Linux-build-name-of-branch)
key: ${{ runner.os }}-build-release-${{ env.GITHUB_REF_SLUG }}
path: |
~/.cache/emsdk
- name: Build release
run: |
docker run --rm \
-v $GITHUB_WORKSPACE:/workspace \
--workdir /workspace \
-v ~/.cache/emsdk:/emsdk/upstream/emscripten/cache/ \
emscripten/emsdk:latest sh -c "emmake make -j2 OPTIM=2 DEBUG=0; chmod 777 -R /emsdk/upstream/emscripten/cache"
- name: FrontPage 2000
run: |
mkdir -p www-release
cp bin/{gaem.data,gaem.wasm,gaem.js,index.html} www-release
echo "https://albertvaka.github.io/nbgf/${{ env.GITHUB_REF_SLUG }}" >> www-release/README.md
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: EmscriptenRelease
path: www-release
web-debug:
runs-on: ubuntu-latest
name: Emscripten debug build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find and define GITHUB_REF_SLUG
uses: rlespinasse/github-slug-action@v4
- name: Cache
uses: actions/cache@v4
with:
# use branch name for cache invalidation (Linux-build-name-of-branch)
key: ${{ runner.os }}-build-debug-${{ env.GITHUB_REF_SLUG }}
path: |
~/.cache/emsdk
- name: Build debug
run: |
docker run --rm \
-v $GITHUB_WORKSPACE:/workspace \
--workdir /workspace \
-v ~/.cache/emsdk:/emsdk/upstream/emscripten/cache/ \
emscripten/emsdk:latest sh -c "emmake make -j2 OPTIM=1 DEBUG=1; chmod 777 -R /emsdk/upstream/emscripten/cache"
- name: FrontPage 2000
run: |
mkdir -p www-debug
cp bin/{gaem.data,gaem.wasm,gaem.js,index.html} www-debug
echo "https://albertvaka.github.io/nbgf/${{ env.GITHUB_REF_SLUG }}/debug" >> www-debug/README.md
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: EmscriptenDebug
path: www-debug
deploy-web:
needs: [ web-debug, web-release ]
concurrency: deploy-github-io
runs-on: ubuntu-latest
name: Publish emscripten builds
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find and define GITHUB_REF_SLUG
uses: rlespinasse/github-slug-action@v4
- uses: actions/download-artifact@v4
with:
name: EmscriptenRelease
path: www
- uses: actions/download-artifact@v4
with:
name: EmscriptenDebug
path: www/debug
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
repository-name: albertvaka/albertvaka.github.io
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: main
folder: www
target-folder: nbgf/${{ env.GITHUB_REF_SLUG }}