-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (145 loc) · 4.08 KB
/
ci-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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: CI build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
env:
EMSCRIPTEN_VERSION: 3.1.71
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-ccache-${{ env.EMSCRIPTEN_VERSION }}-debug
- name: Emscripten cache
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/${{ github.run_id }}/emsdk-main
key: ${{ runner.os }}-emsdk-${{ env.EMSCRIPTEN_VERSION }}-debug
- name: Setup Emscripten toolchain
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- name: Build
run: ./build.sh
build-rel:
runs-on: ubuntu-latest
env:
EMSCRIPTEN_VERSION: 3.1.71
steps:
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-ccache-${{ env.EMSCRIPTEN_VERSION }}-rel
- name: Emscripten cache
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/${{ github.run_id }}/emsdk-main
key: ${{ runner.os }}-emsdk-${{ env.EMSCRIPTEN_VERSION }}-rel
- name: Setup Emscripten toolchain
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- name: build-rel
run: CMAKE_BUILD_TYPE=Release ./build.sh
- name: Stage files for upload to GitHub Pages
run: |
mkdir deploy
cp build_rel/client.* deploy/
mv deploy/client.html deploy/index.html
- name: Upload files for later stages
uses: actions/upload-artifact@v4
with:
name: build-rel-artifacts
path: ./deploy
- name: Upload files to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: ./deploy
deploy-pages:
runs-on: ubuntu-latest
needs: build-rel
permissions:
pages: write # Permissions needed to deploy to GitHub Pages
id-token: write # Permissions needed for OIDC authentication
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
build-electron-linux:
runs-on: ubuntu-latest
needs: build-rel
steps:
- uses: actions/checkout@v4
- name: Setup Node toolchain
uses: actions/setup-node@v4
with:
node-version: 20
- name: Download artifacts from build-rel
uses: actions/download-artifact@v4
with:
name: build-rel-artifacts
path: ./deploy
- name: Copy artifacts to Electron
run: |
mv deploy/* electron/webgpu-demo3/src/
- name: Build
run: |
cd electron/webgpu-demo3
npm install
npm run make -- --platform linux
# TODO: publish
# TODO: cache node
build-electron-win32:
runs-on: windows-latest
needs: build-rel
steps:
- uses: actions/checkout@v4
- name: Setup Node toolchain
uses: actions/setup-node@v4
with:
node-version: 20
- name: Download artifacts from build-rel
uses: actions/download-artifact@v4
with:
name: build-rel-artifacts
path: ./deploy
- name: Copy artifacts to Electron
run: |
Move-Item -Path "deploy\*" -Destination "electron\webgpu-demo3\src"
- name: Build
run: |
cd electron\webgpu-demo3
npm install
npm run make -- --platform win32
# TODO: publish
# TODO: cache node
build-electron-darwin:
if: false # Stage disabled
runs-on: ubuntu-latest
needs: build-rel
steps:
- uses: actions/checkout@v4
- name: Setup Node toolchain
uses: actions/setup-node@v4
with:
node-version: 20
- name: Download artifacts from build-rel
uses: actions/download-artifact@v4
with:
name: build-rel-artifacts
path: ./deploy
- name: Copy artifacts to Electron
run: |
mv deploy/* electron/webgpu-demo3/src/
- name: Build
run: |
cd electron/webgpu-demo3
npm install
npm run make -- --platform darwin
# TODO: publish
# TODO: cache node