diff --git a/release/build-and-deploy.sh b/release/build-and-deploy.sh index 72e10bd..449080e 100755 --- a/release/build-and-deploy.sh +++ b/release/build-and-deploy.sh @@ -22,7 +22,7 @@ find builds -mindepth 1 -delete if [ "$1" = "nightly" ]; then export UPDATE_FLAGS="-DAUTOUPDATE=OFF -DINFORM_UPDATE=OFF" export UPDATE_FLAGS_MACOS="-DINFORM_UPDATE=OFF" - V="$(curl -s https://raw.githubusercontent.com/$MAIN_REPO_USER/$MAIN_REPO_NAME/$MAIN_REPO_BRANCH/src/game/version.h | grep "^#define GAME_RELEASE_VERSION_INTERNAL" | cut -d' ' -f3)" + V="$(curl -s https://raw.githubusercontent.com/$MAIN_REPO_USER/$MAIN_REPO_NAME/$MAIN_REPO_BRANCH/src/game/version.h | grep "^#define GAME_RELEASE_VERSION_INTERNAL" | cut -d'"' -f2)" export VERSION="$V-$(date -d '+2 hours' +%Y%m%d)" ./build.sh $VERSION &> builds/DDNet-nightly.log || { echo "build.sh failed, see builds/DDNet-nightly.log"; exit 1 } @@ -53,7 +53,7 @@ elif [ "$1" = "playground" ]; then export UPDATE_FLAGS_MACOS="-DINFORM_UPDATE=OFF" export MAIN_REPO_USER=Jupeyy export MAIN_REPO_BRANCH=playground - V="$(curl -s https://raw.githubusercontent.com/$MAIN_REPO_USER/$MAIN_REPO_NAME/$MAIN_REPO_BRANCH/src/game/version.h | grep "^#define GAME_RELEASE_VERSION_INTERNAL" | cut -d' ' -f3)" + V="$(curl -s https://raw.githubusercontent.com/$MAIN_REPO_USER/$MAIN_REPO_NAME/$MAIN_REPO_BRANCH/src/game/version.h | grep "^#define GAME_RELEASE_VERSION_INTERNAL" | cut -d'"' -f2)" export VERSION="$V-$(date -d '+2 hours' +%Y%m%d)" ./build.sh $VERSION &> builds/DDNet-playground.log || { echo "build.sh failed, see builds/DDNet-playground.log"; exit 1 } elif [ "$1" = "rc" ]; then diff --git a/release/build.sh b/release/build.sh index 7e9fa0e..27ef96d 100755 --- a/release/build.sh +++ b/release/build.sh @@ -27,7 +27,7 @@ set -ex # always without autoupdater and without update info. For nightlies and RCs use: # UPDATE_FLAGS="-DAUTOUPDATE=OFF -DINFORM_UPDATE=OFF" UPDATE_FLAGS_MACOS=-DINFORM_UPDATE=OFF UPDATE_FLAGS="${UPDATE_FLAGS:--DAUTOUPDATE=ON}" -UPDATE_FLAGS_MACOS="${UPDATE_FLAGS_MACOS:-}" +UPDATE_FLAGS_MACOS="${UPDATE_FLAGS_MACOS:--DAUTOUPDATE=ON}" MAIN_REPO_USER="${MAIN_REPO_USER:-ddnet}" MAIN_REPO_NAME="${MAIN_REPO_NAME:-ddnet}" @@ -301,6 +301,8 @@ rm -rf ddnet-source $MAIN_REPO_NAME-$MAIN_REPO_COMMIT $LIBS_REPO_NAME-$LIBS_REPO unzip -q main.zip mv $MAIN_REPO_NAME-$MAIN_REPO_COMMIT ddnet-source curl -s https://api.github.com/repos/ddnet/ddnet/commits/master | jq -r ".commit.committer.date" | xargs -I{} date -d {} +%s > ddnet-source/source_date_epoch +# Builds from the source download have no git repository to read the revision from +echo $MAIN_REPO_COMMIT > ddnet-source/git_revision cp -r ddnet-source DDNet-$VERSION export DDNET_GIT_SHORTREV_HASH=$MAIN_REPO_COMMIT diff --git a/update/update.sh b/update/update.sh index 90c37ea..710cb9a 100755 --- a/update/update.sh +++ b/update/update.sh @@ -40,6 +40,19 @@ if ls DDNet-$VERSION-linux_x86_64/*.so 2>&1 > /dev/null; then for i in DDNet-$VERSION-linux_x86_64/*.so; do mcp $i ${i:r:t}-linux-x86_64.so; done fi +dmg2img -s -i /var/www/downloads/DDNet-$VERSION-macos.dmg -o DDNet-macos.img +MACOS_LOOP=$(losetup -f --show -P DDNet-macos.img) +mkdir -p macos-mnt +mount -t hfsplus -o ro ${MACOS_LOOP}p1 macos-mnt +tar -C macos-mnt -c --owner=0 --group=0 DDNet.app | xz -T0 > DDNet-macos.tar.xz.$$.tmp +mv DDNet-macos.tar.xz.$$.tmp DDNet-macos.tar.xz +tar -C macos-mnt -c --owner=0 --group=0 DDNet-Server.app | xz -T0 > DDNet-Server-macos.tar.xz.$$.tmp +mv DDNet-Server-macos.tar.xz.$$.tmp DDNet-Server-macos.tar.xz +umount macos-mnt +losetup -d $MACOS_LOOP +rmdir macos-mnt +rm DDNet-macos.img + cp update.json update.json.old && mv update.json.new update.json rm -r DDNet-$OLD_VERSION-*