Skip to content

Commit

Permalink
Merge pull request #34 from dkonar/fix-export-tile-loading
Browse files Browse the repository at this point in the history
Fix resource loading on export
  • Loading branch information
SamuelRabreau authored Feb 13, 2025
2 parents a43a6b5 + 3a70b6a commit 84ebdef
Show file tree
Hide file tree
Showing 16 changed files with 331 additions and 355 deletions.
88 changes: 44 additions & 44 deletions .github/actions/build-godot/action.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: 'Build Godot'
description: 'Build Godot applications for Windows, macOS, and Linux'
name: "Build Godot"
description: "Build Godot applications for Windows, macOS, and Linux"

inputs:
project-dir:
description: 'The path to the Godot project (folder that contains the project.godot file)'
description: "The path to the Godot project (folder that contains the project.godot file)"
required: false
default: ''
default: ""
build-dir:
description: 'The chosen build directory'
description: "The chosen build directory"
required: true
default: 'build'
default: "build"
godot-executable:
description: 'The path to the Godot executable'
description: "The path to the Godot executable"
required: false
default: /Applications/Godot.app/Contents/MacOS/Godot

runs:
using: 'composite'
using: "composite"
steps:
- name: Open Godot editor for reimport
shell: bash
working-directory: ${{ inputs.project-dir }}
run: ${{ inputs.godot-executable }} --import --headless --verbose

- name: Build macOS application
shell: bash
working-directory: ${{ inputs.project-dir }}
Expand All @@ -37,48 +37,48 @@ runs:
run: |
cd ${{ inputs.build-dir }}/macos
tar -cvf ./macos.tar --exclude='*.command' ./*
- uses: actions/upload-artifact@v4
with:
name: macos
path: ${{ inputs.project-dir }}/${{ inputs.build-dir }}/macos/macos.tar

- name: Build Windows application
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
mkdir -p ${{ inputs.build-dir }}/windows
${{ inputs.godot-executable }} --export-debug Windows --headless
[ "$(ls -A ${{ inputs.build-dir }}/windows)" ]
# - name: Build Windows application
# shell: bash
# working-directory: ${{ inputs.project-dir }}
# run: |
# mkdir -p ${{ inputs.build-dir }}/windows
# ${{ inputs.godot-executable }} --export-debug Windows --headless
# [ "$(ls -A ${{ inputs.build-dir }}/windows)" ]

- name: Compress Windows build
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
cd ${{ inputs.build-dir }}/windows
zip -m ./windows.zip ./*
# - name: Compress Windows build
# shell: bash
# working-directory: ${{ inputs.project-dir }}
# run: |
# cd ${{ inputs.build-dir }}/windows
# zip -m ./windows.zip ./*

- uses: actions/upload-artifact@v4
with:
name: windows
path: ${{ inputs.project-dir }}${{ inputs.build-dir }}/windows/windows.zip
# - uses: actions/upload-artifact@v4
# with:
# name: windows
# path: ${{ inputs.project-dir }}${{ inputs.build-dir }}/windows/windows.zip

- name: Build Linux application
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
mkdir -p ${{ inputs.build-dir }}/linux
${{ inputs.godot-executable }} --export-debug Linux --headless
[ "$(ls -A ${{ inputs.build-dir }}/linux)" ]
# - name: Build Linux application
# shell: bash
# working-directory: ${{ inputs.project-dir }}
# run: |
# mkdir -p ${{ inputs.build-dir }}/linux
# ${{ inputs.godot-executable }} --export-debug Linux --headless
# [ "$(ls -A ${{ inputs.build-dir }}/linux)" ]

- name: Compress Linux build (to preserve permissions)
shell: bash
working-directory: ${{ inputs.project-dir }}
run: |
cd ${{ inputs.build-dir }}/linux
tar -cvf ./linux.tar ./*
# - name: Compress Linux build (to preserve permissions)
# shell: bash
# working-directory: ${{ inputs.project-dir }}
# run: |
# cd ${{ inputs.build-dir }}/linux
# tar -cvf ./linux.tar ./*

- uses: actions/upload-artifact@v4
with:
name: linux
path: ${{ inputs.project-dir }}${{ inputs.build-dir }}/linux/linux.tar
# - uses: actions/upload-artifact@v4
# with:
# name: linux
# path: ${{ inputs.project-dir }}${{ inputs.build-dir }}/linux/linux.tar
7 changes: 6 additions & 1 deletion src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Thumbs.db
dev/*
demo/*
*.import
!textureAtlas.png.import
!Castle.png.import
!DesertDay.png.import
!ForestDay.png.import
!ForestNight.png.import
default_bus_layout.tres
default_env.tres
godot-mod-player.png
Expand All @@ -13,4 +18,4 @@ project.godot
TestScene.tscn
TestScene.gd
global.gd
build/*
build/*
Empty file added src/Data/Music/Swamp/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions src/addons/realmz_export_plugin/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class RealmzExportPlugin extends EditorExportPlugin:
func _export_begin(features: PackedStringArray, is_debug: bool, path: String, flags: int) -> void:
_export_dir(path.get_base_dir(), "Data")
_export_dir(path.get_base_dir(), "Campaigns")
_export_dir(path.get_base_dir(), "Profiles")

func _export_dir(export_root: String, source_dir_name: String):
var src_dir_path = ProjectSettings.globalize_path("res://" + source_dir_name)
Expand Down
34 changes: 34 additions & 0 deletions src/icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bf1myxlor32wj"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
2 changes: 1 addition & 1 deletion src/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config_version=5
[application]

config/name="Realmz"
config/version="0.0.2"
config/version="0.0.3"
run/main_scene="res://scenes/Main.tscn"
config/features=PackedStringArray("4.3")
config/icon="res://icon.png"
Expand Down
Loading

0 comments on commit 84ebdef

Please sign in to comment.