Skip to content

Update CI to move resources.zip to the public folder #28

Update CI to move resources.zip to the public folder

Update CI to move resources.zip to the public folder #28

Workflow file for this run

name: Build example
on:
workflow_dispatch:
push:
branches:
- main
- 'feat/**'
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
# 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 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
bash ./dev_build_web.sh
# Checkout alt version and build it
# We use it to test how the game will suffer the outdated LiveUpdate version of the resources.
git reset --hard
git fetch origin alt-version
git switch alt-version
rm -rf build
mkdir -p build/bundle
PLATFORM=wasm-web
BUNDLE_DIR=old-version
java -jar bob.jar --email f@b.com --auth 123 --texture-compression true --bundle-output build/bundle/${PLATFORM} --build-report-html "build/bundle/build_report_${BUNDLE_DIR}.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"
mv build/bundle/*.html "public/"
mv "build/bundle/${PLATFORM}/liveupdate_reszip_demo" "public/${BUNDLE_DIR}"
find "public/" | sort -z
- name: Deploy to Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: public
if: github.ref == 'refs/heads/main'