From f22b6cffb935ec53ab1e8e29452b1ad641969c3c Mon Sep 17 00:00:00 2001 From: Chris Racioppo Date: Sun, 28 Nov 2021 12:24:07 -0500 Subject: [PATCH] Feature/CI-CD (#22) * Initial CI changes * Renaming godot-export action * Rename godot-export * Adding missing shell command * removing project name * Removing composite action * Fixing if statement * Restricting builds to main or on demand only * Adding PWA support * Disabling main for testing * Fixing mobile bug * Adding concurrency * Fixing names * Enabling on main only --- .github/workflows/godot-ci.yml | 42 +++++++++++++++++++ .gitignore | 7 ++-- export_presets.cfg | 76 ++++++++++++++++++++++++++++++++++ src/Level/SplashScreen.gd | 1 + 4 files changed, 122 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/godot-ci.yml create mode 100644 export_presets.cfg diff --git a/.github/workflows/godot-ci.yml b/.github/workflows/godot-ci.yml new file mode 100644 index 0000000..f52f717 --- /dev/null +++ b/.github/workflows/godot-ci.yml @@ -0,0 +1,42 @@ +name: "Godot CI" +on: + workflow_dispatch: + push: + branches: [main] + +concurrency: ci-${{ github.ref }} + +jobs: + export-godot: + strategy: + matrix: + export_template: ["Windows Desktop", "HTML5"] + godot_version: [3.4] + name: Export + runs-on: ubuntu-latest + container: + image: barichello/godot-ci:${{ matrix.godot_version }} + steps: + - name: Checkout Code + uses: actions/checkout@v2 + with: + lfs: true + - name: Setup Export Templates + run: | + mkdir -v -p ~/.local/share/godot/templates + mv /root/.local/share/godot/templates/${{ matrix.godot_version }}.stable ~/.local/share/godot/templates/${{ matrix.godot_version }}.stable + - name: Build Project + run: | + mkdir -v -p "build" + godot -v --export "${{ matrix.export_template }}" + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.export_template }} + path: build/ + - name: Publish to GitHub Pages + if: matrix.export_template == 'HTML5' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build diff --git a/.gitignore b/.gitignore index 1580326..78c5867 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,10 @@ # Godot-specific ignores .import/ -export.cfg -export_presets.cfg logs/ -*.exe -*.pck + +# Godot compiled binaries +build/ # Mono-specific ignores .mono/ diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..4780b18 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,76 @@ +[preset.0] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/gh-game-off-bug.exe" +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +binary_format/64_bits=true +binary_format/embed_pck=false +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +texture_format/no_bptc_fallbacks=true +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PoolStringArray( ) +application/icon="" +application/file_version="0.0.1" +application/product_version="0.0.1" +application/company_name="RacBros Gaming" +application/product_name="Bug Jam" +application/file_description="" +application/copyright="" +application/trademarks="" + +[preset.1] + +name="HTML5" +platform="HTML5" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="build/index.html" +script_export_mode=1 +script_encryption_key="" + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +variant/export_type=0 +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=true +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=true +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=1 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color( 0, 0, 0, 1 ) diff --git a/src/Level/SplashScreen.gd b/src/Level/SplashScreen.gd index 6168289..fccba1b 100644 --- a/src/Level/SplashScreen.gd +++ b/src/Level/SplashScreen.gd @@ -8,6 +8,7 @@ func _input(event: InputEvent) -> void: event.is_action_pressed("attack") || event.is_action_pressed("jump") || event.is_action_pressed("pause") + || event is InputEventMouseButton ): get_tree().set_input_as_handled() var changed = get_tree().change_scene_to(first_scene)