-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the resources file name to check the version of the resources (#10)
* Add resources version checking * Update README * Update docs * Update docs * Example project runs well from the IDE * Update CI * Update docs
- Loading branch information
1 parent
a187ccc
commit c44417e
Showing
13 changed files
with
254 additions
and
76 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 |
---|---|---|
@@ -1,3 +1 @@ | ||
/build2 | ||
/build-v1 | ||
/build-alt | ||
/public |
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 |
---|---|---|
|
@@ -25,35 +25,27 @@ jobs: | |
run: | | ||
lsb_release -a | ||
mkdir -p build/bundle/public | ||
# Download the latest bob.jar | ||
BOB_SHA1=${DEFOLD_BOB_SHA1:-$(curl -s 'https://d.defold.com/stable/info.json' | jq -r .sha1)} | ||
BOB_LOCAL_SHA1=$((java -jar build/bundle/bob.jar --version | cut -d' ' -f6) || true) | ||
if [ "${BOB_LOCAL_SHA1}" != "${BOB_SHA1}" ]; then wget --progress=dot:mega -O build/bundle/bob.jar "https://d.defold.com/archive/${BOB_SHA1}/bob/bob.jar"; fi | ||
java -jar build/bundle/bob.jar --version | ||
BOB_LOCAL_SHA1=$((java -jar bob.jar --version | cut -d' ' -f6) || true) | ||
if [ "${BOB_LOCAL_SHA1}" != "${BOB_SHA1}" ]; then wget --progress=dot:mega -O bob.jar "https://d.defold.com/archive/${BOB_SHA1}/bob/bob.jar"; fi | ||
java -jar bob.jar --version | ||
# Build the project | ||
java -jar build/bundle/bob.jar --email [email protected] --auth 123 --texture-compression true --bundle-output build/bundle/js-web --build-report-html build/bundle/public/build_report_latest.html --platform js-web --archive --liveupdate yes --variant debug resolve build bundle | ||
# Move LiveUpdate .zip file into the bundle dir as "resources.zip" | ||
mv build/liveupdate_output/*.zip build/bundle/js-web/liveupdate_reszip_demo/resources.zip | ||
# Move to the public directory | ||
mv build/bundle/js-web/liveupdate_reszip_demo build/bundle/public/latest | ||
./dev_build_web.sh | ||
# Checkout alt version and build it | ||
# We use it to test how the game will suffer the different resources in the resources.zip. | ||
# We use it to test how the game will suffer the outdated LiveUpdate version of the resources. | ||
git fetch origin alt-version | ||
git switch alt-version | ||
rm -rf build/default | ||
java -jar build/bundle/bob.jar --email [email protected] --auth 123 --texture-compression true --bundle-output build/bundle/js-web --build-report-html build/bundle/public/build_report_alt-version.html --platform js-web --archive --liveupdate yes --variant debug resolve build bundle | ||
java -jar bob.jar --email [email protected] --auth 123 --texture-compression true --bundle-output build/bundle/js-web --build-report-html build/bundle/public/build_report_alt-version.html --platform js-web --archive --liveupdate yes --variant debug resolve build bundle | ||
mv build/liveupdate_output/*.zip build/bundle/js-web/liveupdate_reszip_demo/resources.zip | ||
mv build/bundle/js-web/liveupdate_reszip_demo build/bundle/public/alt-version | ||
mv build/bundle/js-web/liveupdate_reszip_demo public/old-version | ||
- name: Deploy to Pages 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: build/bundle/public | ||
folder: public | ||
if: github.ref == 'refs/heads/main' |
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 |
---|---|---|
|
@@ -10,5 +10,6 @@ Thumbs.db | |
builtins | ||
/editor-script-lua-format | ||
/.vscode | ||
/bundle | ||
/public | ||
/reszip.ini | ||
/bob.jar |
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 |
---|---|---|
@@ -1,17 +1,43 @@ | ||
#!/bin/bash | ||
|
||
# Download bob.jar like that: | ||
# wget "https://github.com/defold/defold/releases/download/1.6.1/bob.jar" -O bob.jar | ||
# wget "https://github.com/defold/defold/releases/download/1.6.2/bob.jar" -O bob.jar | ||
|
||
# Plus, the script uses https://www.npmjs.com/package/http-server to serve local files. | ||
|
||
set -e | ||
|
||
PLATFORM=wasm-web | ||
|
||
mkdir -p public | ||
|
||
# BUNDLE 1 | ||
BUNDLE_DIR=bundle-1 | ||
RESZIP_INI="reszip.ini" | ||
RESOURCES_ZIP="resources_$(date +%s).zip" | ||
echo -e "[liveupdate_reszip]\nfilename = ${RESOURCES_ZIP}\npreload_file = ${RESOURCES_ZIP}\n\n" > "${RESZIP_INI}" | ||
sed -i 's/"enabled", true/"enabled", false/' example/level2/set_alt_text.script | ||
|
||
rm -rf build | ||
mkdir -p build/bundle | ||
java -jar bob.jar --email [email protected] --auth 123 --texture-compression true --settings "${RESZIP_INI}" --bundle-output build/bundle/${PLATFORM} --build-report-html build/bundle/build_report_latest.html --platform ${PLATFORM} --architectures ${PLATFORM} --archive --liveupdate yes --variant debug resolve build bundle | ||
mv build/liveupdate_output/*.zip "build/bundle/${PLATFORM}/liveupdate_reszip_demo/${RESOURCES_ZIP}" | ||
rm -f "${RESZIP_INI}" | ||
mv "build/bundle/${PLATFORM}/liveupdate_reszip_demo" "public/${BUNDLE_DIR}" | ||
|
||
# BUNDLE 2 | ||
BUNDLE_DIR=bundle-2 | ||
RESZIP_INI="reszip.ini" | ||
RESOURCES_ZIP="resources_$(date +%s).zip" | ||
echo -e "[liveupdate_reszip]\nfilename = ${RESOURCES_ZIP}\npreload_file = ${RESOURCES_ZIP}\n\n" > "${RESZIP_INI}" | ||
sed -i 's/"enabled", false/"enabled", true/' example/level2/set_alt_text.script | ||
|
||
rm -rf build | ||
mkdir -p build/public | ||
java -jar bob.jar --email [email protected] --auth 123 --texture-compression true --bundle-output build/bundle/${PLATFORM} --build-report-html build/public/build_report_latest.html --platform ${PLATFORM} --architectures ${PLATFORM} --archive --liveupdate yes --variant debug resolve build bundle | ||
mv build/liveupdate_output/*.zip build/bundle/${PLATFORM}/liveupdate_reszip_demo/resources.zip | ||
# (cd build/bundle/${PLATFORM}/liveupdate_reszip_demo/ && http-server -c-) | ||
http-server -c- | ||
mkdir -p build/bundle | ||
java -jar bob.jar --email [email protected] --auth 123 --texture-compression true --settings "${RESZIP_INI}" --bundle-output build/bundle/${PLATFORM} --build-report-html build/bundle/build_report_latest.html --platform ${PLATFORM} --architectures ${PLATFORM} --archive --liveupdate yes --variant debug resolve build bundle | ||
mv build/liveupdate_output/*.zip "build/bundle/${PLATFORM}/liveupdate_reszip_demo/${RESOURCES_ZIP}" | ||
rm -f "${RESZIP_INI}" | ||
mv "build/bundle/${PLATFORM}/liveupdate_reszip_demo" "public/${BUNDLE_DIR}" | ||
|
||
# DONE | ||
# http-server -c- |
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Download bob.jar like that: | ||
# wget "https://github.com/defold/defold/releases/download/1.4.6/bob.jar" -O bob.jar | ||
# wget "https://github.com/defold/defold/releases/download/1.6.2/bob.jar" -O bob.jar | ||
|
||
# Plus, the script uses https://www.npmjs.com/package/http-server to serve local files. | ||
|
||
set -e | ||
|
||
PLATFORM=x86_64-win32 | ||
RESZIP_INI="reszip.ini" | ||
RESOURCES_ZIP="resources_$(date +%s).zip" | ||
echo -e "[liveupdate_reszip]\nfilename = ${RESOURCES_ZIP}\npreload_file = ${RESOURCES_ZIP}\n\n" > "${RESZIP_INI}" | ||
|
||
rm -rf build | ||
mkdir -p build/public | ||
java -jar bob.jar --email [email protected] --auth 123 --texture-compression true --bundle-output build/bundle/${PLATFORM} --build-report-html build/public/build_report_latest.html --platform ${PLATFORM} --archive --liveupdate yes --variant debug resolve build bundle | ||
mv build/liveupdate_output/*.zip build/bundle/${PLATFORM}/liveupdate_reszip_demo/resources.zip | ||
(cd build/bundle/${PLATFORM}/liveupdate_reszip_demo/ && http-server -c-) | ||
java -jar bob.jar --email [email protected] --auth 123 --texture-compression true --settings "${RESZIP_INI}" --bundle-output build/public/${PLATFORM} --build-report-html build/public/build_report_latest.html --platform ${PLATFORM} --architectures ${PLATFORM} --archive --liveupdate yes --variant debug resolve build bundle | ||
mv build/liveupdate_output/*.zip "build/public/${PLATFORM}/liveupdate_reszip_demo/${RESOURCES_ZIP}" | ||
rm -f "${RESZIP_INI}" | ||
http-server -c- |
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 |
---|---|---|
|
@@ -9,3 +9,6 @@ images { | |
margin: 0 | ||
extrude_borders: 2 | ||
inner_padding: 0 | ||
max_page_width: 0 | ||
max_page_height: 0 | ||
rename_patterns: "" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.