diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a436421..8054ee82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ before_script: - apt-get update -qq && apt-get install -y -qq libsdl1.2-dev libpng-dev libsdl-ttf2.0-dev libsdl-image1.2-dev liblua5.1-0-dev zip - - apt-get install -y -qq gcc-mingw-w64-i686 mingw-w64-tools + - apt-get install -y -qq gcc-mingw-w64-i686 mingw-w64-tools nsis stages: - build @@ -18,6 +18,8 @@ job_win32: - "WIN32CROSS=1 make 3rdparty" - "WIN32CROSS=1 make -j3" - "WIN32CROSS=1 make ziprelease" + - "WIN32CROSS=1 make win32installer" artifacts: paths: - "*.zip" + - "install/grafx2*.exe" diff --git a/.travis.yml b/.travis.yml index e7f8f6a6..21776659 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ addons: - libsdl-image1.2-dev - libsdl-ttf2.0-dev - liblua5.2-dev + - nsis sudo: false diff --git a/Makefile b/Makefile index 6813a9b2..b1b1add5 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ OPT = WIN32CROSS=1 \ endif -.PHONY: all tools grafx2 ziprelease 3rdparty +.PHONY: all tools grafx2 ziprelease 3rdparty win32installer all: grafx2 tools @@ -18,3 +18,6 @@ tools: 3rdparty: cd 3rdparty/ && $(OPT)$(MAKE) + +win32installer: + $(MAKE) -C install/ diff --git a/install/Makefile b/install/Makefile new file mode 100644 index 00000000..c8bacda7 --- /dev/null +++ b/install/Makefile @@ -0,0 +1,18 @@ +VERSIONTAG = ../obj/win32/versiontag +VERSION := $(shell cat $(VERSIONTAG)) + +SOURCES = ../src-$(VERSION).tgz +INSTALLER = ../grafx2-$(VERSION).win32.exe + +all: $(INSTALLER) + +$(INSTALLER): WinInstaller.nsi $(SOURCES) $(VERSIONTAG) + sed 's/src-.*.tgz/src-$(VERSION).tgz/' $< | \ + sed 's/VERSION .*/VERSION $(VERSION)/' > new_$< + makensis new_$< + +$(SOURCES): ../grafx2-$(VERSION)-win32.zip + cd .. && unzip grafx2-$(VERSION)-win32.zip src-$(VERSION).tgz + +../grafx2-$(VERSION)-win32.zip: + cd ../src && WIN32CROSS=1 make ziprelease