Skip to content

Commit

Permalink
update game building
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Aug 29, 2023
1 parent a05a55c commit aba736b
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 102 deletions.
17 changes: 9 additions & 8 deletions .github/actions/export-game/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,26 @@ runs:
with:
version: ${{ inputs.version }}

- name: Setup Godot Templates
shell: bash
run: |
mkdir -v -p ~/.local/share/godot/export_templates
mv /root/.local/share/godot/export_templates/${{ inputs.godot_version }}.stable ~/.local/share/godot/export_templates/${{ inputs.godot_version }}.stable
- name: Setup Godot
uses: chickensoft-games/setup-godot@v1
with:
version: ${{ inputs.godot_version }}
use-dotnet: false

- name: Install Addons
shell: bash
run: |
[ -f plug.gd ] && godot --headless -s plug.gd install || true
# workaround: https://github.com/godotengine/godot/pull/68461
- name: Import Assets
shell: bash
run: |
godot --editor --quit --headless
timeout 60 godot --editor --headless || true
- name: Build ${{ inputs.preset }}
shell: bash
run: |
[ -d build ] && rm -r build
mkdir -v -p build/${{ matrix.platform }}
godot --export-release "${{ inputs.preset }}" --headless ./build/${{ matrix.platform }}/${{ inputs.output }}
mkdir -v -p build/${{ inputs.platform }}
timeout 60 godot --export-release "${{ inputs.preset }}" --headless ./build/${{ inputs.platform }}/${{ inputs.output }} || true
22 changes: 11 additions & 11 deletions .github/workflows/release-packaging.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@

name: Release Packaging

on:
push:
branches: [main]
workflow_dispatch:

env:
version: '1.4.0'
godot_version: '4.1'

jobs:
release-packaging:
runs-on: ubuntu-20.04
container:
image: barichello/godot-ci:4.1
timeout-minutes: 30

strategy:
fail-fast: false
Expand All @@ -28,9 +22,9 @@ jobs:
output: Marble.x86_64
preset: Linux/X11

- platform: web
output: index.html
preset: Web
# - platform: web
# output: index.html
# preset: Web

- platform: mac
output: Marble.zip
Expand All @@ -40,13 +34,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup Versions Vars
run: |
echo "game_version=$(cat .version)" >> $GITHUB_ENV
echo "godot_version=$(cat .godot_version)" >> $GITHUB_ENV
./bump_version.sh
- name: Export Marble
uses: ./.github/actions/export-game
with:
platform: ${{ matrix.platform }}
output: ${{ matrix.output }}
preset: ${{ matrix.preset }}
version: ${{ env.version }}
version: ${{ env.game_version }}
godot_version: ${{ env.godot_version }}

- name: Upload artifact
Expand Down
1 change: 1 addition & 0 deletions .godot_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.1.1
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ repos:
files: '[^a-z0-9._/-]'
exclude: |
(?x)^(
.reuse/|
LICENSES/|
public/|
Makefile|
CONTRIBUTING.md|
CREDITS.md|
LICENSE.md|
Expand All @@ -70,7 +72,7 @@ repos:
- --style=file
- -Werror
language: system
files: \.shader$
files: \.gdshader$
exclude: ^addons/
- id: lint-gdscript
name: lint gdscript
Expand Down
1 change: 1 addition & 0 deletions .reuse/REUSE-compliant.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 9 additions & 14 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,20 @@ License: MIT

# Addons

Files: addons/flexible_toon_shader/*
Copyright: 2021 John Wigg
Files: addons/gd-plug/*
Copyright: 2021 Tan Jian Ping
License: MIT
Source: https://github.com/CaptainProton42/FlexibleToonShaderGD
Source: https://github.com/imjp94/gd-plug

Files: addons/fps_graph_overlay/*
Copyright: 2023 Sander Vanhove
Files: addons/debug_menu/*
Copyright: 2023-present Hugo Locurcio and contributors
License: MIT
Source: https://github.com/SanderVanhove/godot-fps-graph-overlay
Source: https://github.com/godot-extended-libraries/godot-debug-menu

Files: addons/kanban_tasks/*
Copyright: 2022-2023 HolonProduction
Files: addons/UniversalFade/*
Copyright: 2019 Tomek
License: MIT
Source: https://github.com/HolonProduction/godot_kanban_tasks

Files: addons/lod/*
Copyright: 2020 Hugo Locurcio and contributors
License: MIT
Source: https://github.com/godot-extended-libraries/godot-lod
Source: https://github.com/KoBeWi/Godot-Universal-Fade

# Models

Expand Down
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.4.0
14 changes: 6 additions & 8 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Credits

## Addons
- "[addons/flexible_toon_shader/*](https://github.com/CaptainProton42/FlexibleToonShaderGD)" by **John Wigg** licensed under [MIT](https://spdx.org/licenses/MIT.html)
- "[addons/fps_graph_overlay/*](https://github.com/SanderVanhove/godot-fps-graph-overlay)" by **Sander Vanhove** licensed under [MIT](https://spdx.org/licenses/MIT.html)
- "[addons/kanban_tasks/*](https://github.com/HolonProduction/godot_kanban_tasks)" by **HolonProduction** licensed under [MIT](https://spdx.org/licenses/MIT.html)
- "[addons/lod/*](https://github.com/godot-extended-libraries/godot-lod)" by **Hugo Locurcio and contributors** licensed under [MIT](https://spdx.org/licenses/MIT.html)
## Assets
### Models
- "[addons/gd-plug/*](https://github.com/imjp94/gd-plug)" by **Tan Jian Ping** licensed under [MIT](https://spdx.org/licenses/MIT.html)
- "[addons/debug_menu/*](https://github.com/godot-extended-libraries/godot-debug-menu)" by **Hugo Locurcio and contributors** licensed under [MIT](https://spdx.org/licenses/MIT.html)
- "[addons/UniversalFade/*](https://github.com/KoBeWi/Godot-Universal-Fade)" by **Tomek** licensed under [MIT](https://spdx.org/licenses/MIT.html)
## Models
- "[assets/blocks/*](https://github.com/Zylann/marbles)" by **Zylann** licensed under [MIT](https://spdx.org/licenses/MIT.html)
### Textures
## Textures
- "[assets/icons/*](https://icons8.com/)" by **Icons8** licensed under [LicenseRef-linksware](https://spdx.org/licenses/LicenseRef-linksware.html)
- "[assets/marble/*](https://ambientcg.com/view?id=Ground037)" by **Lennart Demes** licensed under [CC0-1.0](https://spdx.org/licenses/CC0-1.0.html)
### Fonts
## Fonts
- "[assets/fonts/box_pixies.ttf](https://www.fontspace.com/boxpixies-font-f27657)" by **Heaven Castro** licensed under [CC0-1.0](https://spdx.org/licenses/CC0-1.0.html)
95 changes: 95 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#############
# Variables #
#############

GODOT_VERSION := $(shell cat .godot_version)
RELEASE_NAME = stable
SUBDIR =
GODOT_PLATFORM = linux.x86_64
GODOT_FILENAME = Godot_v${GODOT_VERSION}-${RELEASE_NAME}_${GODOT_PLATFORM}
GODOT_TEMPLATE = Godot_v${GODOT_VERSION}-${RELEASE_NAME}_export_templates.tpz

GAME_NAME = Marble
GAME_VERSION := $(shell cat .version)

#############
# Commands #
#############

mkflower:
mkdir -p .mkflower
mkdir -p .mkflower/build
mkdir -p .mkflower/bin
mkdir -p .mkflower/cache

touch .mkflower/.gitignore
echo '*' >> .mkflower/.gitignore

touch .mkflower/.gdignore

install_godot: mkflower
# curl -X GET "https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}/SHA512-SUMS.txt" --output .mkflower/cache/SHA512-SUMS.txt
# if [ ! -f ".mkflower/cache/${GODOT_FILENAME}" ] || [ "$(cat .mkflower/cache/SHA512-SUMS.txt | grep ${GODOT_FILENAME} | awk -F'[[:space:]]+' '{print $1}')" != "$(sha256sum .mkflower/cache/${GODOT_FILENAME})" ]; then \
curl -X GET "https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}${SUBDIR}/${GODOT_FILENAME}.zip" --output .mkflower/cache/${GODOT_FILENAME}.zip; \
unzip .mkflower/cache/${GODOT_FILENAME}.zip -d .mkflower/cache/; \
cp .mkflower/cache/${GODOT_FILENAME} .mkflower/bin/${GODOT_FILENAME};
# fi

install_templates: mkflower
curl -X GET "https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}${SUBDIR}/${GODOT_TEMPLATE}" --output .mkflower/cache/${GODOT_TEMPLATE}; \
unzip .mkflower/cache/${GODOT_TEMPLATE} -d .mkflower/cache/; \
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${RELEASE_NAME}; \
cp .mkflower/cache/templates/* ~/.local/share/godot/export_templates/${GODOT_VERSION}.${RELEASE_NAME};

install_addons:
.mkflower/bin/${GODOT_FILENAME} --headless --script plug.gd install || true

import_resources:
.mkflower/bin/${GODOT_FILENAME} --headless --export-pack null /dev/null
# timeout 60 .mkflower/bin/${GODOT_FILENAME} --editor || true
# .mkflower/bin/${GODOT_FILENAME} --headless --quit --editor

export_release_linux:
mkdir -p .mkflower/build/linux
.mkflower/bin/${GODOT_FILENAME} --export-release "Linux/X11" --headless .mkflower/build/linux/${GAME_NAME}.x86_64
(cd .mkflower/build/linux && zip ${GAME_NAME}-linux-v${GAME_VERSION}.zip -r .)
mv .mkflower/build/linux/${GAME_NAME}-linux-v${GAME_VERSION}.zip .mkflower/build/${GAME_NAME}-linux-v${GAME_VERSION}.zip

export_release_windows:
mkdir -p .mkflower/build/windows
.mkflower/bin/${GODOT_FILENAME} --export-release "Windows Desktop" --headless .mkflower/build/windows/${GAME_NAME}.exe
(cd .mkflower/build/windows && zip ${GAME_NAME}-windows-v${GAME_VERSION}.zip -r .)
mv .mkflower/build/windows/${GAME_NAME}-windows-v${GAME_VERSION}.zip .mkflower/build/${GAME_NAME}-windows-v${GAME_VERSION}.zip

export_release_mac:
.mkflower/bin/${GODOT_FILENAME} --export-release "macOS" --headless .mkflower/build/${GAME_NAME}-mac-v${GAME_VERSION}.zip

editor:
.mkflower/bin/${GODOT_FILENAME} --editor

godot:
.mkflower/bin/${GODOT_FILENAME} $(ARGS)

run_release:
.mkflower/build/linux/${GAME_NAME}.x86_64

clean_mkflower:
rm -rf .mkflower

clean_godot:
rm -rf .godot

clean_plug:
rm -rf .plugged
find addons/ -type d -not -name 'addons' -not -name 'gd-plug' -exec rm -rf {} \; || true

#############
# Playbook #
#############

clean: clean_mkflower clean_godot clean_plug
build: clean_godot clean_plug install_addons import_resources export_release_linux
run: build run_release

export_release_all: export_release_linux export_release_mac export_release_windows
ci_build: clean install_godot install_templates install_addons import_resources export_release_all
Loading

0 comments on commit aba736b

Please sign in to comment.