Automate release with release script

This commit is contained in:
Christopher Peredy
2021-11-08 17:54:17 +01:00
parent ebb5efdd99
commit ba7d604dfa
4 changed files with 41 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
FlatLogicWorld_v*.zip

View File

@@ -1,5 +1,5 @@
ID: FlatLogicWorld ID: FlatLogicWorld
Name: Flat Logic World Name: Flat Logic World
Author: ChrisP Author: ChrisP
Version: 0.1.0 Version: !VERSION!
Priority: 0 Priority: 0

View File

@@ -2,7 +2,7 @@
<a href="https://github.com/mastercaution/FlatLogicWorld/releases"> <a href="https://github.com/mastercaution/FlatLogicWorld/releases">
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/mastercaution/FlatLogicWorld?logo=github&style=flat-square" /></a> <img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/mastercaution/FlatLogicWorld?logo=github&style=flat-square" /></a>
<a href="https://logicworld.net/" > <a href="https://logicworld.net/" >
<img alt="Logic World Version" src="https://img.shields.io/badge/Logic%20World-v0.90-informational?style=flat-square" /></a> <img alt="Logic World Version" src="https://img.shields.io/badge/Logic%20World-v0.90.1-informational?style=flat-square" /></a>
</p> </p>
@@ -41,6 +41,13 @@ Mod support in Logic World is not finished yet but the mod directory can already
<img alt="Component Selection Presentation" src="https://user-images.githubusercontent.com/16451370/138568439-1233439a-7b93-4853-a55a-af2e60d1d299.gif" /> <img alt="Component Selection Presentation" src="https://user-images.githubusercontent.com/16451370/138568439-1233439a-7b93-4853-a55a-af2e60d1d299.gif" />
</p> </p>
## "Build" it Yourself
You can create the release ZIP file yourself by simply executing the `release.sh` script (Linux only, needs `sed` and `zip` (default on most distros)):
```
utils/release.sh
```
This script will automatically cut out all unnecessary comments and create a ZIP file. The content can be placed directly into the mod folder of Logic World.
> :warning: The version number is taken from the latest git tag.
## Acknowledgements ## Acknowledgements
Huge thanks to Mouse Hat Games (especially Jimmy) for the great game and the modularity making it super easy to create custom themes and other mods! Huge thanks to Mouse Hat Games (especially Jimmy) for the great game and the modularity making it super easy to create custom themes and other mods!

31
utils/release.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
dirname $(readlink -f "$0")
if git rev-parse --git-dir > /dev/null 2>&1; then
VERSION=$(git describe --tag)
else
VERSION="vUNKNOWN"
fi
PREFIX="v"
VERSION_NR=${VERSION#$PREFIX}
mkdir -p build
cp -ru FlatLogicWorld build
IFS_BACKUP=$IFS
IFS=$'\n'
FILES=build/FlatLogicWorld/palettes/*.succ
for palette in $FILES ; do
sed -i '1,2p; /^[[:blank:]]*#/d;s/#.*//' $palette
sed -i 's/[ \t]*$//' $palette
done
IFS=$IFS_BACKUP
sed -i "s/!VERSION!/$VERSION_NR/" build/FlatLogicWorld/manifest.succ
cd build
zip -FSr ../FlatLogicWorld_$VERSION.zip FlatLogicWorld
cd ..
rm -rf build