Export Demo and deploy to Itch.io #2
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" | |
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 | |
- 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/[email protected] | |
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 }} |