Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ebrahimebrahim/knock-the-rock
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufmte committed Sep 30, 2020
2 parents 612d0d8 + 2ab6d13 commit 453c923
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ set -e




GODOT_PROJECT_DIR=ktr
BUILD_DIR_G=../build # This is build directory relative to GODOT_PROJECT_DIR
BUILD_DIR=$GODOT_PROJECT_DIR/$BUILD_DIR_G

BUILD_SUBDIR_WIN=windows
BUILD_SUBDIR_LIN=linux
BUILD_SUBDIR_MAC=macos
COMMIT_HASH_FILE=$GODOT_PROJECT_DIR/commit_hash.txt
VERSION=$(cat ktr/version_number.txt)

ARCHIVE_NAME=knock_the_rock_$VERSION

BUILD_SUBDIR_WIN=${ARCHIVE_NAME}_windows
BUILD_SUBDIR_LIN=${ARCHIVE_NAME}_linux
BUILD_SUBDIR_MAC=${ARCHIVE_NAME}_macos
RELEASE_SUBDIR=release

EXEC_WIN="Knock the Rock.exe"
EXEC_LIN="Knock the Rock.x86_64"
Expand All @@ -21,7 +26,6 @@ EXEC_MAC="Knock the Rock.zip"
RCEDIT=rcedit/rcedit-x64.exe
ICO=ktr/icon.ico

COMMIT_HASH_FILE=$GODOT_PROJECT_DIR/commit_hash.txt


function cleanup {
Expand All @@ -45,11 +49,27 @@ mkdir $BUILD_DIR
mkdir $BUILD_DIR/$BUILD_SUBDIR_WIN
mkdir $BUILD_DIR/$BUILD_SUBDIR_LIN
mkdir $BUILD_DIR/$BUILD_SUBDIR_MAC
mkdir $BUILD_DIR/$RELEASE_SUBDIR


# --- Linux ---

$GODOT --path $GODOT_PROJECT_DIR --export "Linux/X11" "$BUILD_DIR_G/$BUILD_SUBDIR_LIN/$EXEC_LIN"
cp ktr/icon.png $BUILD_DIR/$BUILD_SUBDIR_LIN
cp ktr/icon.png "$BUILD_DIR/$BUILD_SUBDIR_LIN"
cd $BUILD_DIR
tar cfvz $RELEASE_SUBDIR/$BUILD_SUBDIR_LIN.tar.gz $BUILD_SUBDIR_LIN
cd ..



# --- Mac OS ---

$GODOT --path $GODOT_PROJECT_DIR --export "Mac OSX" "$BUILD_DIR_G/$BUILD_SUBDIR_MAC/$EXEC_MAC"
unzip "$BUILD_DIR/$BUILD_SUBDIR_MAC/$EXEC_MAC" -d $BUILD_DIR/$RELEASE_SUBDIR


# --- Windows ---

$GODOT --path $GODOT_PROJECT_DIR --export "Windows Desktop" "$BUILD_DIR_G/$BUILD_SUBDIR_WIN/$EXEC_WIN"

# for setting the windows icon
Expand All @@ -61,7 +81,9 @@ else
wineconsole $RCEDIT "$BUILD_DIR/$BUILD_SUBDIR_WIN/$EXEC_WIN" --set-icon $ICO
fi


cd $BUILD_DIR
zip -r $RELEASE_SUBDIR/$BUILD_SUBDIR_WIN.zip $BUILD_SUBDIR_WIN
cd ..



0 comments on commit 453c923

Please sign in to comment.