Try preload before defold init #15
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
name: Build example | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Install Java ♨️ | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: Build 🔧 | |
env: | |
DEFOLD_BOB_SHA1: ${{ secrets.DEFOLD_BOB_SHA1 }} | |
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 | |
# 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 | |
# Checkout alt version and build it | |
# We use it to test how the game will suffer the different resources in the resources.zip. | |
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 | |
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 | |
- name: Deploy to Pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: build/bundle/public | |
if: github.ref == 'refs/heads/main' |