10
10
branches :
11
11
- master
12
12
repository_dispatch : # listening to rv32emu-prebuilt events
13
- types : [deploy_wasm]
13
+ types : [deploy_wasm, deploy_system_wasm ]
14
14
15
15
jobs :
16
16
wasm-system-deploy :
17
17
if : github.event.pull_request.merged == true ||
18
18
github.event_name == 'workflow_dispatch' ||
19
- github.event_name == 'repository_dispatch'
19
+ github.event_name == 'repository_dispatch' && github.event.action == 'deploy_system_wasm'
20
20
runs-on : ubuntu-latest
21
21
steps :
22
22
- name : Check out the repo
43
43
- name : install emcc
44
44
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
45
45
github.event_name == 'workflow_dispatch' ||
46
- github.event_name == 'repository_dispatch' }}
46
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_system_wasm') }}
47
47
run : |
48
48
git clone https://github.com/emscripten-core/emsdk.git
49
49
cd emsdk
@@ -58,16 +58,16 @@ jobs:
58
58
run : |
59
59
make artifact
60
60
# Hack Cloudflare 403 Forbidden on GitHub Runner for Doom artifact download
61
- wget --header="User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0" \
62
- --header="Referer: https://www.doomworld.com/" \
63
- --header="Accept-Language: en-US,en;q=0.9" \
64
- -O build/shareware_doom_iwad.zip \
65
- "https://www.doomworld.com/3ddownloads/ports/shareware_doom_iwad.zip"
61
+ # wget --header="User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0" \
62
+ # --header="Referer: https://www.doomworld.com/" \
63
+ # --header="Accept-Language: en-US,en;q=0.9" \
64
+ # -O build/shareware_doom_iwad.zip \
65
+ # "https://www.doomworld.com/3ddownloads/ports/shareware_doom_iwad.zip"
66
66
unzip -d build/ build/shareware_doom_iwad.zip
67
67
- name : build with emcc and move application files to /tmp
68
68
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
69
69
github.event_name == 'workflow_dispatch' ||
70
- github.event_name == 'repository_dispatch' }}
70
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_system_wasm') }}
71
71
run : |
72
72
make CC=emcc ENABLE_SYSTEM=1 ENABLE_SDL=1 INITRD_SIZE=32 -j
73
73
mkdir /tmp/rv32emu-system-demo
@@ -80,15 +80,15 @@ jobs:
80
80
- name : Check out the rv32emu-system-demo repo
81
81
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
82
82
github.event_name == 'workflow_dispatch' ||
83
- github.event_name == 'repository_dispatch' }}
83
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_system_wasm') }}
84
84
uses : actions/checkout@v4
85
85
with :
86
86
persist-credentials : false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
87
87
repository : sysprog21/rv32emu-demo
88
88
- name : Create local changes
89
89
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
90
90
github.event_name == 'workflow_dispatch' ||
91
- github.event_name == 'repository_dispatch' }}
91
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_system_wasm') }}
92
92
run : |
93
93
mkdir -p system
94
94
mv /tmp/rv32emu-system-demo/index.html ./system
99
99
- name : Commit files
100
100
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
101
101
github.event_name == 'workflow_dispatch' ||
102
- github.event_name == 'repository_dispatch' }}
102
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_system_wasm') }}
103
103
run : |
104
104
git config --local user.email "github-actions[bot]@users.noreply.github.com"
105
105
git config --local user.name "github-actions[bot]"
@@ -108,17 +108,15 @@ jobs:
108
108
- name : Push changes
109
109
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
110
110
github.event_name == 'workflow_dispatch' ||
111
- github.event_name == 'repository_dispatch' }}
111
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_system_wasm') }}
112
112
uses : ad-m/github-push-action@master
113
113
with :
114
114
repository : sysprog21/rv32emu-demo
115
115
github_token : ${{ secrets.RV32EMU_DEMO_TOKEN }}
116
116
branch : main
117
117
wasm-user-deploy :
118
- needs : wasm-system-deploy # to run jobs sequentially
119
- if : github.event.pull_request.merged == true ||
120
- github.event_name == 'workflow_dispatch' ||
121
- github.event_name == 'repository_dispatch'
118
+ needs : wasm-system-deploy # to run jobs sequentially since two jobs operate on same reposity: rv32emu-demo
119
+ if : always() # ensures wasm-user-deploy runs regardless of the outcome or condition of wasm-system-deploy
122
120
runs-on : ubuntu-latest
123
121
steps :
124
122
- name : Check out the repo
@@ -141,7 +139,7 @@ jobs:
141
139
- name : install emcc
142
140
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
143
141
github.event_name == 'workflow_dispatch' ||
144
- github.event_name == 'repository_dispatch' }}
142
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_wasm') }}
145
143
run : |
146
144
git clone https://github.com/emscripten-core/emsdk.git
147
145
cd emsdk
@@ -156,16 +154,16 @@ jobs:
156
154
run : |
157
155
make artifact
158
156
# Hack Cloudflare 403 Forbidden on GitHub Runner for Doom artifact download
159
- wget --header="User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0" \
160
- --header="Referer: https://www.doomworld.com/" \
161
- --header="Accept-Language: en-US,en;q=0.9" \
162
- -O build/shareware_doom_iwad.zip \
163
- "https://www.doomworld.com/3ddownloads/ports/shareware_doom_iwad.zip"
157
+ # wget --header="User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0" \
158
+ # --header="Referer: https://www.doomworld.com/" \
159
+ # --header="Accept-Language: en-US,en;q=0.9" \
160
+ # -O build/shareware_doom_iwad.zip \
161
+ # "https://www.doomworld.com/3ddownloads/ports/shareware_doom_iwad.zip"
164
162
unzip -d build/ build/shareware_doom_iwad.zip
165
163
- name : build with emcc and move application files to /tmp
166
164
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
167
165
github.event_name == 'workflow_dispatch' ||
168
- github.event_name == 'repository_dispatch' }}
166
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_wasm') }}
169
167
run : |
170
168
make CC=emcc ENABLE_SDL=1
171
169
mkdir /tmp/rv32emu-demo
@@ -179,15 +177,15 @@ jobs:
179
177
- name : Check out the rv32emu-demo repo
180
178
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
181
179
github.event_name == 'workflow_dispatch' ||
182
- github.event_name == 'repository_dispatch' }}
180
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_wasm') }}
183
181
uses : actions/checkout@v4
184
182
with :
185
183
persist-credentials : false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
186
184
repository : sysprog21/rv32emu-demo
187
185
- name : Create local changes
188
186
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
189
187
github.event_name == 'workflow_dispatch' ||
190
- github.event_name == 'repository_dispatch' }}
188
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_wasm') }}
191
189
run : |
192
190
mv /tmp/rv32emu-demo/index.html .
193
191
mv /tmp/rv32emu-demo/coi-serviceworker.min.js .
@@ -198,7 +196,7 @@ jobs:
198
196
- name : Commit files
199
197
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
200
198
github.event_name == 'workflow_dispatch' ||
201
- github.event_name == 'repository_dispatch' }}
199
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_wasm') }}
202
200
run : |
203
201
git config --local user.email "github-actions[bot]@users.noreply.github.com"
204
202
git config --local user.name "github-actions[bot]"
@@ -207,7 +205,7 @@ jobs:
207
205
- name : Push changes
208
206
if : ${{ steps.changed-files.outputs.any_modified == 'true' ||
209
207
github.event_name == 'workflow_dispatch' ||
210
- github.event_name == 'repository_dispatch' }}
208
+ ( github.event_name == 'repository_dispatch' && github.event.action == 'deploy_wasm') }}
211
209
uses : ad-m/github-push-action@master
212
210
with :
213
211
repository : sysprog21/rv32emu-demo
0 commit comments