Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Jan 1, 2024
1 parent 83fdbd9 commit 5676700
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ jobs:
- name: Load dotenv
run: just ci-load-dotenv

- name: Cache Godot
uses: actions/cache@v3
with:
path: |
~/.mkflower/bin
~/.local/share/godot/export_templates/${{ env.godot_version }}.stable
key: ${{ env.godot_version }}

- name: Export
run: just export

Expand Down
30 changes: 23 additions & 7 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,21 @@ dist_dir := justfile_directory() / "dist"

# Godot variables
godot_version := env_var('GODOT_VERSION')
godot_platform := if arch() == "x86" { "linux.x86_32" } else { if arch() == "x86_64" { "linux.x86_64" } else { "" } }
godot_platform := if arch() == "x86" {
"linux.x86_32"
} else {
if arch() == "x86_64" {
"linux.x86_64"
} else {
if arch() == "arm" {
"linux.arm32"
} else {
if arch() == "aarch64" {
"linux.arm64"
} else { "" }
}
}
}
godot_filename := "Godot_v" + godot_version + "-stable_" + godot_platform
godot_template := "Godot_v" + godot_version + "-stable_export_templates.tpz"
godot_bin := bin_dir / godot_filename
Expand Down Expand Up @@ -94,12 +108,14 @@ install-templates:
# Download game plugins
install-addons:
[ -f plug.gd ] && just godot --headless --script plug.gd install force || true
[ -f plug.gd ] && just godot --headless --script plug.gd install || true

# Workaround from https://github.com/godotengine/godot/pull/68461
# Import game resources
import-resources:
timeout 60 just godot --editor --headless --verbose || true
just godot --headless --export-pack null /dev/null
# timeout 60 just godot --editor || true
# just godot --headless --quit --editor

# Updates the game version for export
@bump-version:
Expand Down Expand Up @@ -129,27 +145,27 @@ fmt:
# Export game on Windows
export-windows: bump-version install-addons import-resources
mkdir -p {{ build_dir }}/windows
just godot --export-release '"Windows Desktop"' --headless {{ build_dir }}/windows/{{ game_name }}.exe
just godot --headless --export-release '"Windows Desktop"' {{ build_dir }}/windows/{{ game_name }}.exe
(cd {{ build_dir }}/windows && zip {{ game_name }}-windows-v{{ game_version }}.zip -r .)
mv {{ build_dir }}/windows/{{ game_name }}-windows-v{{ game_version }}.zip {{ dist_dir }}/{{ game_name }}-windows-v{{ game_version }}.zip
rm -rf {{ build_dir }}/windows

# Export game on MacOS
export-mac: bump-version install-addons import-resources
just godot --export-release "macOS" --headless {{ dist_dir }}/{{ game_name }}-mac-v{{ game_version }}.zip
just godot --headless --export-release "macOS" {{ dist_dir }}/{{ game_name }}-mac-v{{ game_version }}.zip

# Export game on Linux
export-linux: bump-version install-addons import-resources
mkdir -p {{ build_dir }}/linux
just godot --export-release "Linux/X11" --headless {{ build_dir }}/linux/{{ game_name }}.x86_64
just godot --headless --export-release "Linux/X11" {{ build_dir }}/linux/{{ game_name }}.x86_64
(cd {{ build_dir }}/linux && zip {{ game_name }}-linux-v{{ game_version }}.zip -r .)
mv {{ build_dir }}/linux/{{ game_name }}-linux-v{{ game_version }}.zip {{ dist_dir }}/{{ game_name }}-linux-v{{ game_version }}.zip
rm -rf {{ build_dir }}/linux

# Export game for the web
export-web: bump-version install-addons import-resources
mkdir -p {{ build_dir }}/web
just godot --export-release "Web" --headless {{ build_dir }}/web/index.html
just godot --headless --export-release "Web" {{ build_dir }}/web/index.html

# Export on all platform
export: export-windows export-mac export-linux
Expand Down

0 comments on commit 5676700

Please sign in to comment.