add automatic build and deploy Makefile
This commit is contained in:
parent
088156f880
commit
5b51be8556
92
Makefile
Normal file
92
Makefile
Normal file
@ -0,0 +1,92 @@
|
||||
name = 'Dodge Bolt'
|
||||
version = 0.1.0
|
||||
love_version = 11.4
|
||||
itchio = rokaspuz/dodge-bolt
|
||||
|
||||
LOVE_WIN32_DIR = build/love-$(love_version)-win32
|
||||
LOVE_WIN64_DIR = build/love-$(love_version)-win64
|
||||
|
||||
all: win32 win64 linux
|
||||
|
||||
love: clean_love
|
||||
mkdir -p build
|
||||
cd src && zip -9 -r ../build/$(name).love .
|
||||
|
||||
win32: clean_windows download-love-win32 love
|
||||
mkdir -p build/win32/$(name)
|
||||
cp -r $(LOVE_WIN32_DIR)/*.dll build/win32/$(name)
|
||||
cp -r $(LOVE_WIN32_DIR)/license.txt build/win32/$(name)
|
||||
cat $(LOVE_WIN32_DIR)/love.exe build/$(name).love > build/win32/$(name)/$(name).exe
|
||||
|
||||
win64: clean_windows download-love-win64 love
|
||||
mkdir -p build/win64/$(name)
|
||||
cp -r $(LOVE_WIN64_DIR)/*.dll build/win64/$(name)
|
||||
cp -r $(LOVE_WIN64_DIR)/license.txt build/win64/$(name)
|
||||
cat $(LOVE_WIN64_DIR)/love.exe build/$(name).love > build/win64/$(name)/$(name).exe
|
||||
|
||||
linux: clean_linux download-appimage love
|
||||
mkdir -p build/linux
|
||||
cd build/linux && ../love.AppImage --appimage-extract
|
||||
cat build/linux/squashfs-root/bin/love build/$(name).love > build/linux/squashfs-root/bin/game
|
||||
chmod +x build/linux/squashfs-root/bin/game
|
||||
cp -f love.desktop build/linux/squashfs-root/love.desktop
|
||||
appimagetool build/linux/squashfs-root build/linux/$(name)
|
||||
rm -rf build/linux/squashfs-root
|
||||
|
||||
deploy: deploy-win32 deploy-win64 deploy-linux
|
||||
|
||||
deploy-win32: download-butler win32
|
||||
cd build/win32 && zip -9 -r $(name).zip .
|
||||
./build/butler push build/win32/$(name).zip $(itchio):win32 --userversion $(version)
|
||||
|
||||
deploy-win64: download-butler win64
|
||||
cd build/win64 && zip -9 -r $(name).zip .
|
||||
./build/butler push build/win64/$(name).zip $(itchio):win64 --userversion $(version)
|
||||
|
||||
deploy-linux: download-butler linux
|
||||
cd build/linux && zip -9 -r $(name).zip .
|
||||
./build/butler push build/linux/$(name).zip $(itchio):linux --userversion $(version)
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
clean_windows:
|
||||
rm -rf build/windows
|
||||
|
||||
clean_linux:
|
||||
rm -rf build/linux
|
||||
|
||||
clean_love:
|
||||
rm -f build/$(name).love
|
||||
|
||||
download-love-win32:
|
||||
ifeq (,$(wildcard ./build/love-${love_version}-win32/))
|
||||
mkdir -p build
|
||||
wget -O build/love-win32.zip https://github.com/love2d/love/releases/download/${love_version}/love-${love_version}-win32.zip
|
||||
unzip build/love-win32.zip -d build
|
||||
rm build/love-win32.zip
|
||||
endif
|
||||
|
||||
download-love-win64:
|
||||
ifeq (,$(wildcard ./build/love-${love_version}-win64/))
|
||||
mkdir -p build
|
||||
wget -O build/love-win64.zip https://github.com/love2d/love/releases/download/${love_version}/love-${love_version}-win64.zip
|
||||
unzip build/love-win64.zip -d build
|
||||
rm build/love-win64.zip
|
||||
endif
|
||||
|
||||
download-appimage:
|
||||
ifeq (,$(wildcard ./build/love.AppImage))
|
||||
mkdir -p build
|
||||
wget -O build/love.AppImage https://github.com/love2d/love/releases/download/${love_version}/love-${love_version}-x86_64.AppImage
|
||||
chmod +x build/love.AppImage
|
||||
endif
|
||||
|
||||
download-butler:
|
||||
ifeq (,$(wildcard ./build/butler))
|
||||
mkdir -p build
|
||||
wget -O build/butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
|
||||
unzip build/butler.zip -d build
|
||||
chmod +x build/butler
|
||||
rm build/butler.zip
|
||||
endif
|
17
build.sh
17
build.sh
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BUILD_NAME="love2d-project"
|
||||
ZIP_OPTIONS="-x '*.xcf' -x '*.kra'"
|
||||
|
||||
# Remove existing contents
|
||||
rm -r build
|
||||
mkdir build
|
||||
|
||||
# Build project
|
||||
echo Building project...
|
||||
cd src
|
||||
zip -q $ZIP_OPTIONS -r ../build/$BUILD_NAME.love *
|
||||
cd - > /dev/null
|
||||
|
||||
# Jobs done
|
||||
echo Done.
|
10
love.desktop
Normal file
10
love.desktop
Normal file
@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Name=Dodge Bolt
|
||||
Comment=A fast paced multiplayer top-down shooter
|
||||
MimeType=application/x-love-game;
|
||||
Exec=game %f
|
||||
Type=Application
|
||||
Categories=Development;Game;
|
||||
Terminal=false
|
||||
Icon=love
|
||||
NoDisplay=true
|
Loading…
Reference in New Issue
Block a user