Export Demo and deploy to Itch.io #7
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: "Export Demo and deploy to Itch.io" | |
permissions: read-all | |
on: | |
workflow_call: | |
workflow_dispatch: | |
env: | |
GODOT_VERSION: 4.3 | |
ITCH_USERNAME: ivorius | |
ITCH_GAME_ID: numdot-demos | |
jobs: | |
# Builds the project. | |
export-web: | |
name: Web Export | |
runs-on: ubuntu-20.04 | |
container: | |
image: barichello/godot-ci:4.3 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
sparse-checkout: 'demo' | |
sparse-checkout-cone-mode: false | |
- name: Setup Godot Export Templates | |
run: | | |
mkdir -v -p ~/.local/share/godot/export_templates/ | |
mv /root/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.stable ~/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.stable | |
# Clean up the extension files we have here already; we'll be using the files from the release downloaded below. | |
- name: Clean demo gdextension | |
working-directory: demo | |
run: | | |
rm -rf addons | |
# Download the relevant NumDot version. | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
# TODO Can we automate choosing the run ID? | |
run-id: 11562444170 | |
name: GDExtension-all | |
path: demo/addons | |
github-token: ${{ github.token }} | |
- name: Web Build | |
working-directory: demo | |
run: | | |
mkdir -v -p build/web | |
godot --headless --verbose --export-release "Web" build/web/index.html | |
- name: Upload Web Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: web | |
path: demo/build/web | |
# Deploys on itch.io. | |
deploy: | |
name: Upload to Itch | |
runs-on: ubuntu-latest | |
needs: export-web | |
strategy: | |
fail-fast: true | |
matrix: | |
channel: | |
- web | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.channel }} | |
path: build/${{ matrix.channel }} | |
# Publishes the build to Itch.io using the butler tool | |
- name: Publish to Itch.io | |
uses: KikimoraGames/itch-publish@v0.0.3 | |
with: | |
butlerApiKey: ${{ secrets.ITCH_API_KEY }} | |
gameData: ./build/${{ matrix.channel }} | |
itchUsername: ${{ env.ITCH_USERNAME }} | |
itchGameId: ${{ env.ITCH_GAME_ID }} | |
buildChannel: ${{ matrix.channel }} | |
buildNumber: ${{ github.run_number }} |