From adbf1dc63fcf136d9b95ffd08059a97127aec8ff Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Mon, 4 Sep 2023 16:42:39 +0300 Subject: [PATCH] Attempt to fix Web builds in GitHub Pages using a workaround for SharedArrayBuffer Thanks to https://github.com/itsas-taldea/moon/blob/e4c1d959e6e54ef94c1152e9b9daab62ba3611a1/.github/workflows/Pipeline.yml#L107-L112 --- .github/workflows/dev-web.yml | 6 ++++++ .github/workflows/release.yml | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev-web.yml b/.github/workflows/dev-web.yml index 66d6ecd04..ba807fbb2 100644 --- a/.github/workflows/dev-web.yml +++ b/.github/workflows/dev-web.yml @@ -32,6 +32,12 @@ jobs: - name: Install rsync 📚 run: | apt-get update && apt-get install -y rsync + # Workaround for SharedArrayBuffer support on GitHub Pages + # See: https://github.com/godotengine/godot-docs/issues/7084 + - run: | + cd ./build/web + curl -fsSL https://github.com/gzuidhof/coi-serviceworker/raw/master/coi-serviceworker.js > coi-serviceworker.js + sed -i 's#\( \)# \n\1#g' index.html - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7966f77ae..b9ec5eafe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -193,12 +193,18 @@ jobs: - name: Install rsync 📚 run: | apt-get update && apt-get install -y rsync + - name: Upload Release Assets to itch.io 🎮 + run: | + butler push ./build/web ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:web --userversion ${{env.TAG}} + # Workaround for SharedArrayBuffer support on GitHub Pages + # See: https://github.com/godotengine/godot-docs/issues/7084 + - run: | + cd ./build/web + curl -fsSL https://github.com/gzuidhof/coi-serviceworker/raw/master/coi-serviceworker.js > coi-serviceworker.js + sed -i 's#\( \)# \n\1#g' index.html - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} single-commit: true folder: build/web # The folder the action should deploy. - - name: Upload Release Assets to itch.io 🎮 - run: | - butler push ./build/web ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:web --userversion ${{env.TAG}}