diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fb1f60..9103751 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,20 +3,71 @@ stages: - test - deploy +before_script: + - apt-get update + - apt-get install -y zip + - mkdir -p bin + - mkdir -p ~/.cache + - mkdir -p ~/.config/godot + - wget http://downloads.tuxfamily.org/godotengine/3.0.2/Godot_v3.0.2-stable_linux_server.64.zip -O godot3-server.zip + - unzip godot3-server.zip + - rm godot3-server.zip + - mv Godot_v3.0.2-stable_linux_server.64 bin/godot3-server + - chmod +x bin/godot3-server + - df -h + - WGET_ARGS='' make install-templates - -job make exports: +export:html5: stage: deploy - before_script: - - apt-get install unzip - - mkdir -p bin - - wget http://downloads.tuxfamily.org/godotengine/3.0.2/Godot_v3.0.2-stable_linux_server.64.zip -O godot3-server.zip - - unzip godot3-server.zip - - chmod +x godot3-server - - mv godot3-server bin/ script: - - GODOT=./bin/godot3-server make export-all + - GODOT=./bin/godot3-server make export-html5 artifacts: - untracked: true + name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_TAG-html5" paths: - build/ + only: + - tags + +export:windows: + stage: deploy + script: + - GODOT=./bin/godot3-server make export-windows + artifacts: + name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_TAG-windows" + paths: + - build/ + only: + - tags + +export:osx: + stage: deploy + script: + - GODOT=./bin/godot3-server make export-osx + artifacts: + name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_TAG-osx" + paths: + - build/ + only: + - tags + +export:linux: + stage: deploy + script: + - GODOT=./bin/godot3-server make export-linux + artifacts: + name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_TAG-linux" + paths: + - build/ + only: + - tags + +export:linux_commit: + stage: deploy + script: + - GODOT=./bin/godot3-server make export-linux + artifacts: + name: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHA-linux" + paths: + - build/ + except: + - tags diff --git a/Makefile b/Makefile index d430691..06e7728 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,15 @@ -GODOT=godot3-server -EXPORT_TEMPLATE_SOURCE=https://downloads.tuxfamily.org/godotengine/3.0.2/Godot_v3.0.2-stable_export_templates.tpz +GODOT?=godot3-server +EXPORT_TEMPLATE_SOURCE?=https://downloads.tuxfamily.org/godotengine/3.0.2/Godot_v3.0.2-stable_export_templates.tpz BUILD_DIR?=build GODOT_PROJECT_PATH?=game PROJECT_NAME?=game - +GODOT_TEMPLATE_DIR?=~/.local/share/godot/templates +GODOT_TEMPLATE_VERSION?=3.0.2.stable TARGET_HTML5?=HTML5 TARGET_WINDOWS?=Windows Desktop TARGET_MACOSX?=Mac OSX TARGET_LINUX?=Linux/X11 - +WGET_ARGS?=-q build-dir: mkdir -p "$(BUILD_DIR)" @@ -18,19 +19,34 @@ clean: export-all: export-html5 export-windows export-osx export-linux export-pack: build-dir - $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "pack" "../$(BUILD_DIR)/$(PROJECT_NAME).pck" + $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export_debug --export "pack" "../$(BUILD_DIR)/$(PROJECT_NAME).pck" export-html5: build-dir mkdir -p "$(BUILD_DIR)/html" - $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_HTML5)" "../$(BUILD_DIR)/html/$(PROJECT_NAME).html" + $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export_debug --export "$(TARGET_HTML5)" "../$(BUILD_DIR)/html/$(PROJECT_NAME).html" zip -j -r "$(BUILD_DIR)/$(PROJECT_NAME)-html5.zip" "$(BUILD_DIR)/html" rm -rf "$(BUILD_DIR)/html" export-windows: build-dir - $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_WINDOWS)" "../$(BUILD_DIR)/$(PROJECT_NAME).exe" + $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export_debug --export "$(TARGET_WINDOWS)" $(PROJECT_NAME).exe + mkdir -p "$(BUILD_DIR)/win/" + mv -t "$(BUILD_DIR)/win/" $(GODOT_PROJECT_PATH)/$(PROJECT_NAME).exe* $(GODOT_PROJECT_PATH)/$(PROJECT_NAME).pck export-osx: build-dir - $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_MACOSX)" "../$(BUILD_DIR)/$(PROJECT_NAME)-osx" + $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export_debug --export "$(TARGET_MACOSX)" $(PROJECT_NAME).osx + mkdir -p "$(BUILD_DIR)/osx/" + # Data is bundled into $(PROJECT_NAME).osx + mv -t "$(BUILD_DIR)/osx/" $(GODOT_PROJECT_PATH)/$(PROJECT_NAME).osx* export-linux: build-dir - $(GODOT) --path "$(GODOT_PROJECT_PATH)" --export "$(TARGET_LINUX)" "../$(BUILD_DIR)/$(PROJECT_NAME)-x11" + $(GODOT) --path $(GODOT_PROJECT_PATH) --export_debug --export "$(TARGET_LINUX)" $(PROJECT_NAME)-x11 + mkdir -p "$(BUILD_DIR)/x11/" + mv -t "$(BUILD_DIR)/x11/" $(GODOT_PROJECT_PATH)/$(PROJECT_NAME)-x11* + +install-templates: + mkdir -p $(GODOT_TEMPLATE_DIR) + wget $(WGET_ARGS) $(EXPORT_TEMPLATE_SOURCE) -O templates.tpz + unzip templates.tpz + mv templates/ $(GODOT_TEMPLATE_DIR)/$(GODOT_TEMPLATE_VERSION) + rm templates.tpz +