Compare commits
15 Commits
878f2fd801
...
actions
| Author | SHA1 | Date | |
|---|---|---|---|
| d6bb4b6aea | |||
| bb6174d417 | |||
| 3c939d55aa | |||
| 9966be50c1 | |||
| 81b8ebb820 | |||
| 1a2d7a22af | |||
| 959e38eb78 | |||
| 8e3c7469aa | |||
| 2765228b93 | |||
| 297a5b89ec | |||
| 8faae72ae7 | |||
| 1a789ab5b2 | |||
| d4bf1c3da7 | |||
| 1c855d1b77 | |||
| daf382e35e |
@@ -5,10 +5,11 @@ on: [push]
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 60
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 60
|
||||||
|
XMAKE_ROOT: "y"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build:
|
Build:
|
||||||
runs-on: ubuntu-test
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 🧾 Check out
|
- name: 🧾 Check out
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -26,8 +27,19 @@ jobs:
|
|||||||
use-dotnet: false
|
use-dotnet: false
|
||||||
include-templates: true
|
include-templates: true
|
||||||
|
|
||||||
|
- name: 🍗 Setup XMake
|
||||||
|
uses: xmake-io/github-action-setup-xmake@v1
|
||||||
|
with:
|
||||||
|
xmake-version: latest
|
||||||
|
actions-cache-folder: '.xmake-cache'
|
||||||
|
actions-cache-key: 'xmake-ubuntu'
|
||||||
|
|
||||||
|
- name: 🐍 Install Python
|
||||||
|
run: xmake require --extra={system=false} -y python
|
||||||
|
|
||||||
- name: ⚙️ XMake config
|
- name: ⚙️ XMake config
|
||||||
run: xmake f -m release -p linux -y
|
# TODO: change that to release
|
||||||
|
run: xmake f -m debug -p linux -y -v
|
||||||
|
|
||||||
- name: 🏗️ Build
|
- name: 🏗️ Build
|
||||||
run: xmake
|
run: xmake
|
||||||
@@ -36,4 +48,13 @@ jobs:
|
|||||||
run: xmake test
|
run: xmake test
|
||||||
|
|
||||||
- name: 🚀 Publish
|
- name: 🚀 Publish
|
||||||
run: xmake p
|
# the first command is needed only for the template
|
||||||
|
run: |
|
||||||
|
xmake gengdextension
|
||||||
|
xmake import-assets
|
||||||
|
xmake p
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Debug Build
|
||||||
|
path: ${{ github.workspace }}/publish
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ encrypt_directory=false
|
|||||||
custom_template/debug=""
|
custom_template/debug=""
|
||||||
custom_template/release=""
|
custom_template/release=""
|
||||||
debug/export_console_wrapper=1
|
debug/export_console_wrapper=1
|
||||||
binary_format/embed_pck=false
|
binary_format/embed_pck=true
|
||||||
texture_format/bptc=true
|
texture_format/bptc=true
|
||||||
texture_format/s3tc=true
|
texture_format/s3tc=true
|
||||||
texture_format/etc=false
|
texture_format/etc=false
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ add_rules("mode.debug", "mode.release")
|
|||||||
set_languages("c++20")
|
set_languages("c++20")
|
||||||
|
|
||||||
-- use latest 4.x version by default
|
-- use latest 4.x version by default
|
||||||
add_requires("godotcpp4")
|
add_requires("godotcpp4 4.2")
|
||||||
|
|
||||||
|
|
||||||
includes("tasks.lua")
|
includes("tasks.lua")
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
|
||||||
|
if is_mode("debug") then
|
||||||
|
add_defines("DEBUG_ENABLED")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
-- more on https://xmake.io/#/manual/project_target
|
-- more on https://xmake.io/#/manual/project_target
|
||||||
target(PROJECT_NAME)
|
target(PROJECT_NAME)
|
||||||
set_kind("shared")
|
set_kind("shared")
|
||||||
@@ -35,8 +41,9 @@ target(PROJECT_NAME)
|
|||||||
on_run(
|
on_run(
|
||||||
(function(godot_project_folder)
|
(function(godot_project_folder)
|
||||||
return function(target)
|
return function(target)
|
||||||
os.execv("echo", {"godot --path", godot_project_folder})
|
local cmd = format("godot --path %s", godot_project_folder)
|
||||||
os.exec("godot --path " .. godot_project_folder)
|
os.execv("echo", {cmd})
|
||||||
|
os.exec(cmd)
|
||||||
end
|
end
|
||||||
end)(GODOT_PROJECT_FOLDER)
|
end)(GODOT_PROJECT_FOLDER)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
-- target_platform: the target platform, like "Windows Desktop"
|
-- target_platform: the target platform, like "Windows Desktop"
|
||||||
-- name: the export execute name, it will be endswith ".exe" on windows
|
-- name: the export execute name, it will be endswith ".exe" on windows
|
||||||
task("export")
|
task("export")
|
||||||
on_run((function(godot_project_folder, publish_folder)
|
on_run((function(godot_project_folder, publish_folder, project_name)
|
||||||
return function(target_platform)
|
return function(target_platform)
|
||||||
local name = godot_project_folder
|
local name = godot_project_folder
|
||||||
|
|
||||||
@@ -35,13 +35,15 @@ task("export")
|
|||||||
|
|
||||||
local godot_project_file = path.join(godot_project_folder, "project.godot")
|
local godot_project_file = path.join(godot_project_folder, "project.godot")
|
||||||
|
|
||||||
local export_path = path.absolute(path.join(publish_folder, name))
|
local export_path = path.absolute(path.join(publish_folder, project_name))
|
||||||
|
|
||||||
os.execv("echo", {"godot", godot_project_file, export_mode, target_platform, export_path})
|
local cmd = format("godot %s --headless --%s %s %s", godot_project_file, export_mode, "\"" .. target_platform .. "\"", export_path)
|
||||||
os.exec("godot %s --headless --%s %s %s", godot_project_file, export_mode, "\"" .. target_platform .. "\"", export_path)
|
|
||||||
|
os.execv("echo", {cmd})
|
||||||
|
os.exec(cmd)
|
||||||
end
|
end
|
||||||
|
|
||||||
end)(GODOT_PROJECT_FOLDER, PUBLISH_FOLDER))
|
end)(GODOT_PROJECT_FOLDER, PUBLISH_FOLDER, PROJECT_NAME))
|
||||||
task_end()
|
task_end()
|
||||||
|
|
||||||
|
|
||||||
@@ -202,3 +204,22 @@ android.release.arm64 = "res://lib/libProjectName.android_release_arm64.so"
|
|||||||
description = "Generate gdextension file",
|
description = "Generate gdextension file",
|
||||||
}
|
}
|
||||||
task_end()
|
task_end()
|
||||||
|
|
||||||
|
|
||||||
|
task("import-assets")
|
||||||
|
on_run((function(godot_project_folder, project_name)
|
||||||
|
return function ()
|
||||||
|
local godot_project_file = path.join(godot_project_folder, "project.godot")
|
||||||
|
|
||||||
|
local cmd = format("godot --headless --import %s", godot_project_file)
|
||||||
|
os.execv("echo", {cmd})
|
||||||
|
os.exec(cmd)
|
||||||
|
end
|
||||||
|
end)(GODOT_PROJECT_FOLDER, PROJECT_NAME))
|
||||||
|
|
||||||
|
set_menu {
|
||||||
|
usage = "xmake import-assets",
|
||||||
|
|
||||||
|
description = "Import project assets",
|
||||||
|
}
|
||||||
|
task_end()
|
||||||
Reference in New Issue
Block a user