2828 butler-url : https://broth.itch.ovh/butler/windows-amd64/LATEST/archive/default
2929 - os : macos-14
3030 triplet : arm64-osx
31- platform-name : macos.x64
31+ platform-name : macos.arm64
3232 butler-url : https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
3333 - os : ubuntu-24.04
3434 triplet : x64-linux
@@ -128,7 +128,7 @@ jobs:
128128 tag : ${{ github.ref }}
129129 overwrite : true
130130 - name : Install Butler
131- if : github.ref == 'refs/heads/main'
131+ if : github.ref == 'refs/heads/main' && matrix.butler-url
132132 run : |
133133 mkdir ~/bin
134134 cd ~/bin
@@ -138,7 +138,72 @@ jobs:
138138 echo "~/bin" >> $GITHUB_PATH
139139 ~/bin/butler -V
140140 - name : Upload to Itch
141- if : github.ref == 'refs/heads/main'
141+ if : github.ref == 'refs/heads/main' && matrix.butler-url
142142 env :
143143 BUTLER_API_KEY : ${{ secrets.BUTLER_API_KEY }}
144144 run : butler push dist/${{ env.archive-name }} hexdecimal/${{ env.project-name }}:${{ matrix.platform-name }}-latest
145+
146+ emscripten :
147+ runs-on : ubuntu-24.04
148+ env :
149+ EM_VERSION : 4.0.5
150+ EM_CACHE_FOLDER : " emsdk-cache"
151+ steps :
152+ - uses : actions/checkout@v4
153+ with :
154+ submodules : true
155+ - name : Restore vcpkg and its artifacts
156+ uses : actions/cache@v4
157+ with :
158+ path : |
159+ build/vcpkg_installed/
160+ ${{ env.VCPKG_ROOT }}
161+ !${{ env.VCPKG_ROOT }}/buildtrees
162+ !${{ env.VCPKG_ROOT }}/packages
163+ !${{ env.VCPKG_ROOT }}/downloads
164+ key : wasm32-emscripten-${{ hashFiles('vcpkg.json', '.git/modules/vcpkg/HEAD') }}
165+ - name : Setup cache
166+ id : cache-system-libraries
167+ uses : actions/cache@v4
168+ with :
169+ path : ${{env.EM_CACHE_FOLDER}}
170+ key : ${{env.EM_VERSION}}-${{ runner.os }}
171+ - uses : mymindstorm/setup-emsdk@v14
172+ with :
173+ version : ${{env.EM_VERSION}}
174+ actions-cache-folder : ${{env.EM_CACHE_FOLDER}}
175+ - name : Verify
176+ run : emcc -v
177+ - uses : lukka/get-cmake@latest
178+ - name : Configure
179+ run : emcmake cmake -S . -B build -G Ninja
180+ -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
181+ -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
182+ -DVCPKG_TARGET_TRIPLET=wasm32-emscripten
183+ -DCMAKE_BUILD_TYPE="${{ env.BUILD_TYPE }}"
184+ - name : Build
185+ run : cmake --build build
186+ - name : Show contents of the build directory
187+ run : find build
188+ - uses : actions/upload-artifact@v4
189+ with :
190+ name : emscripten-builds
191+ path : build/bin
192+ retention-days : 7
193+ if-no-files-found : error
194+ compression-level : 6
195+ - name : Install Butler
196+ if : github.ref == 'refs/heads/main'
197+ run : |
198+ mkdir ~/bin
199+ cd ~/bin
200+ curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
201+ unzip butler.zip
202+ chmod +x butler
203+ echo "~/bin" >> $GITHUB_PATH
204+ ~/bin/butler -V
205+ - name : Upload to Itch
206+ if : github.ref == 'refs/heads/main'
207+ env :
208+ BUTLER_API_KEY : ${{ secrets.BUTLER_API_KEY }}
209+ run : butler push dist/${{ env.archive-name }} hexdecimal/${{ env.project-name }}:emscripten-latest
0 commit comments