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,75 @@ 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+ strategy :
149+ matrix :
150+ build_type : [Debug, Release]
151+ env :
152+ EM_VERSION : 4.0.5
153+ EM_CACHE_FOLDER : " emsdk-cache"
154+ steps :
155+ - uses : actions/checkout@v4
156+ with :
157+ submodules : true
158+ - name : Restore vcpkg and its artifacts
159+ uses : actions/cache@v4
160+ with :
161+ path : |
162+ build/vcpkg_installed/
163+ ${{ env.VCPKG_ROOT }}
164+ !${{ env.VCPKG_ROOT }}/buildtrees
165+ !${{ env.VCPKG_ROOT }}/packages
166+ !${{ env.VCPKG_ROOT }}/downloads
167+ key : wasm32-emscripten-${{ hashFiles('vcpkg.json', '.git/modules/vcpkg/HEAD') }}
168+ - name : Setup cache
169+ id : cache-system-libraries
170+ uses : actions/cache@v4
171+ with :
172+ path : ${{env.EM_CACHE_FOLDER}}
173+ key : ${{env.EM_VERSION}}-${{ runner.os }}
174+ - uses : mymindstorm/setup-emsdk@v14
175+ with :
176+ version : ${{env.EM_VERSION}}
177+ actions-cache-folder : ${{env.EM_CACHE_FOLDER}}
178+ - name : Verify
179+ run : emcc -v
180+ - uses : lukka/get-cmake@latest
181+ - name : Configure
182+ run : emcmake cmake -S . -B build -G Ninja
183+ -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="${EMSDK}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
184+ -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
185+ -DVCPKG_TARGET_TRIPLET=wasm32-emscripten
186+ -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}"
187+ - name : Build
188+ run : cmake --build build
189+ - name : Show contents of the build directory
190+ run : find build
191+ - uses : actions/upload-artifact@v4
192+ with :
193+ name : emscripten-${{ matrix.build_type }}
194+ path : build/bin
195+ retention-days : 7
196+ if-no-files-found : error
197+ compression-level : 6
198+ - name : Install Butler
199+ if : github.ref == 'refs/heads/main' && matrix.build_type == 'Release'
200+ run : |
201+ mkdir ~/bin
202+ cd ~/bin
203+ curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
204+ unzip butler.zip
205+ chmod +x butler
206+ echo "~/bin" >> $GITHUB_PATH
207+ ~/bin/butler -V
208+ - name : Upload to Itch
209+ if : github.ref == 'refs/heads/main' && matrix.build_type == 'Release'
210+ env :
211+ BUTLER_API_KEY : ${{ secrets.BUTLER_API_KEY }}
212+ run : butler push dist/${{ env.archive-name }} hexdecimal/${{ env.project-name }}:emscripten-latest
0 commit comments