forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request CleverRaven#70697 from nornagon/emscripten-new
add webassembly build
- Loading branch information
1 parent
f8cf42f
commit 87cf016
Showing
17 changed files
with
585 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Emscripten build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'android/**' | ||
- 'build-data/osx/**' | ||
- 'doc/**' | ||
- 'doxygen_doc/**' | ||
- 'lang/**' | ||
- 'lgtm/**' | ||
- 'tools/**' | ||
- '!tools/format/**' | ||
- 'utilities/**' | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'android/**' | ||
- 'build-data/osx/**' | ||
- 'doc/**' | ||
- 'doxygen_doc/**' | ||
- 'lang/**' | ||
- 'lgtm/**' | ||
- 'tools/**' | ||
- '!tools/format/**' | ||
- 'utilities/**' | ||
|
||
# We only care about the latest revision of a PR, so cancel previous instances. | ||
concurrency: | ||
group: emscripten-build-${{ github.event.pull_request.number || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build_catatclysm: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: mymindstorm/setup-emsdk@v13 | ||
|
||
- name: Prepare web data | ||
run: ./build-scripts/prepare-web-data.sh | ||
|
||
- name: Build with emcc (emscripten) | ||
run: ./build-scripts/build-emscripten.sh | ||
|
||
- name: Assemble web bundle | ||
run: ./build-scripts/prepare-web.sh | ||
|
||
- name: Create artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: play-cdda | ||
path: build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
|
||
emsdk install 3.1.51 | ||
emsdk activate 3.1.51 | ||
|
||
make -j`nproc` NATIVE=emscripten BACKTRACE=0 TILES=1 TESTS=0 RUNTESTS=0 RELEASE=1 cataclysm-tiles.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
|
||
rm -rf web_bundle | ||
|
||
BUNDLE_DIR=web_bundle | ||
DATA_DIR=$BUNDLE_DIR/data | ||
mkdir -p $DATA_DIR | ||
cp -R data/{core,font,fontdata.json,json,mods,names,raw,motd,credits,title,help} $DATA_DIR/ | ||
cp -R gfx $BUNDLE_DIR/ | ||
|
||
# Remove .DS_Store files. | ||
find web_bundle -name ".DS_Store" -type f -exec rm {} \; | ||
|
||
# Remove obsolete mods. | ||
echo "Removing obsolete mods..." | ||
for MOD_DIR in $DATA_DIR/mods/*/ ; do | ||
if jq -e '.[] | select(.type == "MOD_INFO") | .obsolete' "$MOD_DIR/modinfo.json" >/dev/null; then | ||
echo "$MOD_DIR is obsolete, excluding from web_bundle..." | ||
rm -rf $MOD_DIR | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -exo pipefail | ||
|
||
mkdir -p build/ | ||
cp \ | ||
index.html \ | ||
cataclysm-tiles.{data,js,wasm} \ | ||
data/font/Terminus.ttf \ | ||
build | ||
cp data/cataicon.ico build/favicon.ico |
Oops, something went wrong.