From 16c87db06cb3523a6d6d4c9dcd81d02cc7fa31ed Mon Sep 17 00:00:00 2001 From: Martijn de Boer Date: Sat, 29 Oct 2022 15:22:41 +0200 Subject: [PATCH] Builds --- .drone.yml | 7 ++- Boon.toml | 42 ---------------- tools/build.sh | 75 +++++++++++++++++++++++++++++ tools/macos-info.plist | 107 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 185 insertions(+), 46 deletions(-) delete mode 100644 Boon.toml create mode 100644 tools/build.sh create mode 100644 tools/macos-info.plist diff --git a/.drone.yml b/.drone.yml index a4b5266..77b6b79 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,10 +13,9 @@ steps: - apk update - apk upgrade - apk --no-cache add curl zip git - - curl -s -L https://github.com/dmoa/love-export/releases/download/v1.2/install.sh | bash - - love-export -D - - ls - - ls releases + - chmod +x tools/build.sh + - bash tools/build.sh + - ls release # - name: release # image: plugins/gitea-release # settings: diff --git a/Boon.toml b/Boon.toml deleted file mode 100644 index 279befe..0000000 --- a/Boon.toml +++ /dev/null @@ -1,42 +0,0 @@ -[project] -authors = "The Impossible Astronaut" -description = "A small game about a set of spaceships" -email = "buildartifacts@sexybiggetje.nl" -package_name = "vision" -title = "Vision" -url = "https://git.biggetje.net/martijn/vision/" -uti = "com.theimpossibleastronaut.vision" -version = "v0.1" - -[build] -output_directory = "release" -ignore_list = [ - # Git - "^.git.*", - - # Binary files - ".zip$", - ".tar.gz$", - ".love$", - ".exe$", - ".psd$", - - # Boon-specific files and directories - "Boon.toml", - "build.sh", - "release", - "tools", - ".drone.yml", - ".luacheckrc", - "vision.sublime-.*" -] - -# List of targets to build for -# Possible values: "love", "windows", "macos", "all" -targets = ["all"] - -# If this is set to true, then the default ignore list will not be -# merged with the project specific ignore list. This allows the -# ignore list to be completely overwritten. -exclude_default_ignore_list = false - diff --git a/tools/build.sh b/tools/build.sh new file mode 100644 index 0000000..7f5e296 --- /dev/null +++ b/tools/build.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# Slightly based on love-exporter at https://github.com/dmoa/love-export/blob/master/main.sh + +VISION_COMMIT=`git ls-remote https://git.biggetje.net/martijn/vision.git | grep "refs/heads/main" | cut -f 1 | head -c 8` +LOVE_VERSION=11.4 +LOVE_WIN64=https://github.com/love2d/love/releases/download/$LOVE_VERSION/love-$LOVE_VERSION-win64.zip +LOVE_MACOS=https://github.com/love2d/love/releases/download/$LOVE_VERSION/love-$LOVE_VERSION-macos.zip + +build() { + echo "Building release" + cp -Rf {assets,bullet,captain,planet,scene,shaders,ship,vendor} build/game/ + cp -f *.lua build/game/ + find build/game -maxdepth 5 -type f -name '*.psd' -delete +} + +downloadlove() { + echo "Downloading binaries" + cd build + + curl -L -O $LOVE_WIN64 + unzip love-$LOVE_VERSION-win64.zip + mv ./*win64 win + rm love-$LOVE_VERSION-win64.zip + cd win + rm love.ico game.ico lovec.exe readme.txt changes.txt + cd .. + + mkdir mac + cd mac + curl -L -O $LOVE_MACOS + unzip love-$LOVE_VERSION-macos.zip + rm love-$LOVE_VERSION-macos.zip + cd .. + + # todo appimage + + cd .. +} + +makelove() { + cd build/game + echo "Generating love file" + zip -9 -r ../../release/vision-$VISION_COMMIT.love . + cd ../.. +} + +makewin64() { + echo "Generating Win64 build" + cat "build/win/love.exe" "release/vision-$VISION_COMMIT.love" > "build/win/vision.exe" + rm "build/win/love.exe" + cd build/win + zip -9 -r ../../release/vision-$VISION_COMMIT-win64.zip . + cd ../.. +} + +makemac() { + echo "Generating MacOS build" + cp "release/vision-$VISION_COMMIT.love" "build/mac/love.app/Contents/Resources" + mv "build/mac/love.app" "build/mac/vision.app" + cd build/mac + cp -f "../../tools/macos-info.plist" "vision.app/Contents/Info.plist" + zip -9 -r ../../release/vision-$VISION_COMMIT-macos.zip . + cd ../.. +} + +echo "Building the game on LÖVE $LOVE_VERSION!" +rm -Rf build/* release/* +mkdir -p build/game +mkdir -p release + +build +downloadlove +makelove +makewin64 +makemac diff --git a/tools/macos-info.plist b/tools/macos-info.plist new file mode 100644 index 0000000..dcd5dc1 --- /dev/null +++ b/tools/macos-info.plist @@ -0,0 +1,107 @@ + + + + + BuildMachineOSBuild + 21D49 + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + love + + CFBundleTypeIconFile + GameIcon + CFBundleTypeName + LÖVE Project + CFBundleTypeRole + Viewer + LSHandlerRank + Owner + LSItemContentTypes + + org.love2d.love-game + + LSTypeIsPackage + 1 + + + CFBundleTypeName + Folder + CFBundleTypeOSTypes + + fold + + CFBundleTypeRole + Viewer + LSHandlerRank + None + + + CFBundleTypeIconFile + Document + CFBundleTypeName + Document + CFBundleTypeOSTypes + + **** + + CFBundleTypeRole + Editor + + + CFBundleExecutable + love + CFBundleIconFile + OS X AppIcon + CFBundleIconName + OS X AppIcon + CFBundleIdentifier + com.theimpossibleastronaut.vision + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Vision + CFBundlePackageType + APPL + CFBundleShortVersionString + 11.4a + CFBundleSignature + LoVe + CFBundleSupportedPlatforms + + MacOSX + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13C100 + DTPlatformName + macosx + DTPlatformVersion + 12.1 + DTSDKBuild + 21C46 + DTSDKName + macosx12.1 + DTXcode + 1321 + DTXcodeBuild + 13C100 + LSApplicationCategoryType + public.app-category.games + LSMinimumSystemVersion + 10.7 + NSHighResolutionCapable + + NSHumanReadableCopyright + © 2006-2022 LÖVE Development Team + NSPrincipalClass + NSApplication + NSSupportsAutomaticGraphicsSwitching + + +