Skip to content

Commit

Permalink
ci: don't upload debug build to cf, too big, and a bunch of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
julie-dujardin committed Aug 3, 2024
1 parent e81278d commit 0243731
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
strategy:
fail-fast: false
matrix:
build_type: [release, debug]
build_type: [release] # debug blocks_plus_plus.wasm is 62.4 MiB and I'm not uploading more stuff to R2

runs-on: ubuntu-22.04
environment: main
Expand All @@ -198,13 +198,12 @@ jobs:
run: |
cp deploy/cloudflare-pages/* wasm32/
# exclude the engine file from cloudflare pages because it's too big
engine_hash=($(sha256sum wasm32/index.side.wasm))
export engine_hash=($(sha256sum wasm32/index.side.wasm))
rm wasm32/index.side.wasm
# ugly hack to force godot to pull the engine from another domain
build_type=${{ matrix.build_type }}
sed -i "s/{{{DIR}}}/${build_type}_${GODOT_VERSION}_${engine_hash[1]}/" deploy/templates/readAsyncNew
sed -e '/readAsync = (url, onload, onerror) => {/{r readAsyncNew' -e 'd;}' wasm32/index.js > _index.js
mv _index.js wasm32/index.js
export build_type=${{ matrix.build_type }}
sed -i -e "s|{{{DIR}}}|${build_type}_${GODOT_VERSION}_${engine_hash[0]}|g" deploy/templates/readAsyncNew
sed -i -e '/readAsync = (url, onload, onerror) => {/{r deploy/templates/readAsyncNew' -e 'd;}' wasm32/index.js
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
Expand Down
33 changes: 16 additions & 17 deletions .github/workflows/compile_godot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ jobs:
publish-web:
name: Publish web engine to cloudflare
runs-on: ubuntu-22.04
environment: main
needs: [compile-web]
steps:
- name: Download web templates
Expand All @@ -258,8 +259,6 @@ jobs:
name: templates-web-${{ env.GODOT_VERSION }}
- name: Prepare Upload
run: |
unzip templates-web-${{ env.GODOT_VERSION }}
unzip web_dlink_release.zip -d release_files
mkdir release_engine
mv release_files/godot.side.wasm release_engine/index.side.wasm
Expand All @@ -273,8 +272,8 @@ jobs:
echo "DEBUG_HASH=${debug_hash[1]}" >> $GITHUB_ENV
# Only Upload the engine if it doesn't exist already
curl --head --fail https://godot-engine.static.ilus.pw/index.side.wasm
if [ $? -ne 0 ]; then
curl --head --fail https://godot-engine.static.ilus.pw/release_${{ env.GODOT_VERSION }}_${{ env.RELEASE_HASH }}/index.side.wasm || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
echo "UPLOAD_ENGINE=true" >> $GITHUB_ENV
else
echo "UPLOAD_ENGINE=false" >> $GITHUB_ENV
Expand All @@ -294,16 +293,16 @@ jobs:
SOURCE_DIR: release_engine
DEST_DIR: release_${{ env.GODOT_VERSION }}_${{ env.RELEASE_HASH }}

- name: Upload debug engine to R2
if: env.UPLOAD_ENGINE == 'true'
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
AWS_S3_ENDPOINT: https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com
AWS_S3_BUCKET: ${{ secrets.R2_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_REGION: auto
SOURCE_DIR: debug_engine
DEST_DIR: debug_${{ env.GODOT_VERSION }}_${{ env.DEBUG_HASH }}
# - name: Upload debug engine to R2
# if: ${{ env.UPLOAD_ENGINE == 'true' }}
# uses: jakejarvis/s3-sync-action@master
# with:
# args: --delete
# env:
# AWS_S3_ENDPOINT: https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com
# AWS_S3_BUCKET: ${{ secrets.R2_BUCKET }}
# AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
# AWS_REGION: auto
# SOURCE_DIR: debug_engine
# DEST_DIR: debug_${{ env.GODOT_VERSION }}_${{ env.DEBUG_HASH }}

0 comments on commit 0243731

Please sign in to comment.