Skip to content

Commit

Permalink
Update build to nightly for unittests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
GsLogiMaker committed May 6, 2024
1 parent fd350f0 commit 4f6d14f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ jobs:

- name: 🚣‍♂️ Convert dev plugin to nightly format
run: |
godot -s ./addons/glecs/_build_for_nightly.gd
cd addons/glecs
godot -s _build_for_nightly.gd
cd ../..
- name: 🌙 Clone nightly branch
run: |
Expand Down
37 changes: 9 additions & 28 deletions addons/glecs/_build_for_nightly.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ extends SceneTree

const NIGHTLY_NAME:= "GlecsNightly"

const GLECS:= "res://addons/glecs/"
const GLECS:= "res://"
const OLD_EXTENSION:= "glecs.gdextension"
const NEW_EXTENSION:= "glecs.gdextension.release"
const SOURCE:= "rust"
const CFG:= "plugin.cfg"
const THIS:= "_build_for_nightly.cfg"

func _init() -> void:
var dir:= DirAccess.open(GLECS)
Expand All @@ -21,37 +19,20 @@ func _init() -> void:
var has_error:= false
if not dir.file_exists(OLD_EXTENSION):
push_error(
"Unexpected file structure. Failed to find \"%s/%s\"",
GLECS,
OLD_EXTENSION,
"Unexpected file structure. Failed to find \"%s%s\"" %
[GLECS, OLD_EXTENSION],
)
has_error = true
if not dir.file_exists(NEW_EXTENSION):
push_error(
"Unexpected file structure. Failed to find \"%s/%s\"",
GLECS,
NEW_EXTENSION,
)
has_error = true
if not dir.file_exists(SOURCE):
push_error(
"Unexpected file structure. Failed to find \"%s/%s\"",
GLECS,
SOURCE,
"Unexpected file structure. Failed to find \"%s%s\"" %
[GLECS, NEW_EXTENSION],
)
has_error = true
if not dir.file_exists(CFG):
push_error(
"Unexpected file structure. Failed to find \"%s/%s\"",
GLECS,
CFG,
)
has_error = true
if not dir.file_exists(THIS):
push_error(
"Unexpected file structure. Failed to find \"%s/%s\"",
GLECS,
THIS,
"Unexpected file structure. Failed to find \"%s%s\"" %
[GLECS, CFG],
)
has_error = true

Expand All @@ -69,7 +50,7 @@ func _init() -> void:
return

err = dir.rename(NEW_EXTENSION, OLD_EXTENSION)
prints("Rename %s to %s"% [OLD_EXTENSION, NEW_EXTENSION])
prints("Rename %s to %s"% [NEW_EXTENSION, OLD_EXTENSION])
if err != OK:
push_error("Error while renaming new extension:", error_string(err))
quit(1)
Expand All @@ -78,7 +59,7 @@ func _init() -> void:
var plugin_cfg:= ConfigFile.new()

err = plugin_cfg.load("%s/%s" % [GLECS, CFG])
prints("Set plung.cfg")
prints("Set plungin.cfg")
if err != OK:
push_error("Error while loading plugin.cfg:", error_string(err))
quit(1)
Expand Down

0 comments on commit 4f6d14f

Please sign in to comment.