Skip to content

Commit

Permalink
Update ci workflow for exports
Browse files Browse the repository at this point in the history
  • Loading branch information
hatmix committed Jun 13, 2024
1 parent b45b30b commit aebc940
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 13 deletions.
51 changes: 39 additions & 12 deletions .github/workflows/godot-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ on:
- '!ATTRIBUTION.md'
- '.gitignore'
- '.gitattributes'
workflow-dispatch:
inputs:
exporttype:
description: 'Export type (debug/release)'
default: debug
required: false
type: choice
options:
- debug
- release

env:
GODOT_VERSION: 4.2.2
Expand All @@ -32,7 +42,7 @@ jobs:
#ls /root/.local/share/godot/templates/
#mv /root/.local/share/godot/templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
- name: Install Plugins Fix Imports
- name: Install Plugins
run: |
godot --headless --path . -s plug.gd install || true
Expand All @@ -41,24 +51,33 @@ jobs:
godot --headless --path . --export-pack FixImports /dev/null 2>&1 >/dev/null
- name: Test
id: test
run: |
pwd
godot --headless --path . -s addons/gut/gut_cmdln.gd -gexit
- name: Export Web
id: export-web
- name: Remove Dev-only Plugins
run: |
godot --headless --path . -s plug.gd install production || true
- name: Export
id: export
if: steps.test.outcome == 'success'
env:
ITCHIO_USERNAME: ${{ secrets.ITCHIO_USERNAME }}
ITCHIO_GAME: ${{ secrets.ITCHIO_GAME }}
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
EXPORT_TYPE: ${{ exporttype }}
if: env.ITCHIO_USERNAME && env.ITCHIO_GAME && env.BUTLER_API_KEY
run: |
mkdir -v -p exports/web
godot --headless --path . --export-release "Web" exports/web/index.html
godot --headless --path . --export-${EXPORT_TYPE} "Web" exports/web/index.html
godot --headless --path . --export-${EXPORT_TYPE} "Linux" exports/linux/${ITCHIO_GAME}.x86_64
godot --headless --path . --export-${EXPORT_TYPE} "macOS" exports/macos/${ITCHIO_GAME}.zip
godot --headless --path . --export-${EXPORT_TYPE} "Windows" exports/windows/${ITCHIO_GAME}.exe
find exports -name '*'
- name: Cache butler files
id: cache-butler
if: steps.export-web.outcome == 'success'
if: steps.export.outcome == 'success'
uses: actions/cache@v4
with:
path: butler
Expand All @@ -69,7 +88,7 @@ jobs:
ITCHIO_USERNAME: ${{ secrets.ITCHIO_USERNAME }}
ITCHIO_GAME: ${{ secrets.ITCHIO_GAME }}
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
if: steps.cache-butler.outputs.cache-hit != 'true' && steps.export-web.outcome == 'success'
if: steps.cache-butler.outputs.cache-hit != 'true' && steps.export.outcome == 'success'
run: |
wget -O butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
Expand All @@ -83,7 +102,15 @@ jobs:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
if: env.ITCHIO_USERNAME && env.ITCHIO_GAME && env.BUTLER_API_KEY && steps.export-web.outcome == 'success'
run: |
./butler push exports/web/ ${ITCHIO_USERNAME}/${ITCHIO_GAME}:HTML5
./butler status ${ITCHIO_USERNAME}/${ITCHIO_GAME}:HTML5
./butler push exports/windows/ ${ITCHIO_USERNAME}/${ITCHIO_GAME}:windows
./butler status ${ITCHIO_USERNAME}/${ITCHIO_GAME}:windows
if [ -f exports/web/index.html ]; then
./butler push exports/web/ ${ITCHIO_USERNAME}/${ITCHIO_GAME}:HTML5
fi
if [ -f exports/linux/${ITCHIO_GAME}.x86_64 ]; then
./butler push exports/windows/ ${ITCHIO_USERNAME}/${ITCHIO_GAME}:linux
fi
if [ -f exports/macos/${ITCHIO_GAME}.zip ]; then
./butler push exports/windows/ ${ITCHIO_USERNAME}/${ITCHIO_GAME}:macos
fi
if [ -f exports/windows/${ITCHIO_GAME}.exe ]; then
./butler push exports/windows/ ${ITCHIO_USERNAME}/${ITCHIO_GAME}:windows
fi
2 changes: 1 addition & 1 deletion plug.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extends "res://addons/gd-plug/plug.gd"

func _plugging():
plug("bitwes/Gut", {"tag": "v9.2.1"})
plug("bitwes/Gut", {"tag": "v9.2.1", "dev": true})

0 comments on commit aebc940

Please sign in to comment.