Tweak and enable snapshots

master
Elias Fleckenstein 2022-07-13 01:26:18 +02:00
parent 9d10dc5dbb
commit 212fc530c1
No known key found for this signature in database
GPG Key ID: 06927A5199D6C9B2
6 changed files with 53 additions and 59 deletions

View File

@ -26,6 +26,3 @@ jobs:
SECRET: ${{ secrets.ELIDRAGON_UPLOAD_TOKEN }}
run: |
./upload.sh

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
build*/*
build/*
!build/debug.sh
!build/debug_loop.sh
dragonblocks_alpha*
snapshot/*

View File

@ -3,7 +3,7 @@
A multiplayer voxelgame for POSIX systems.
It has been ported to Linux, Windows, FreeBSD and OpenBSD, but may work on other systems.
Head to <https://www.elidragon.tk/dragonblocks_alpha/> for snapshot and release builds (CURRENTLY DOWN).
Head to <https://www.elidragon.tk/dragonblocks_alpha/> for snapshot and release builds.
## Invocation

View File

@ -1,48 +1,49 @@
#!/bin/bash
set -e
VERSION=`git tag --points-at HEAD`
if [[ $VERSION = "" ]]; then
VERSION=`git rev-parse --short HEAD`
fi
version="$(git describe --tags)"
mkdir "snapshot"
cd "snapshot"
build="build"
snapshot="dragonblocks_alpha-$version"
toolchain=""
dotexe=""
dotsh=".sh"
flags="-Ofast"
BUILD=build-release
SNAPSHOT=dragonblocks_alpha-$VERSION
TOOLCHAIN=
DOTEXE=
DOTSH=".sh"
FLAGS="-Ofast"
if [[ "$1" != "" ]]; then
BUILD=build-$1
SNAPSHOT=dragonblocks_alpha-$1-$VERSION
TOOLCHAIN=$1.cmake
DOTEXE=".exe"
DOTSH=".bat"
FLAGS="$FLAGS -static"
build="$build-$1"
snapshot="$snapshot-$1"
toolchain="$1.cmake"
dotexe=".exe"
dotsh=".bat"
flags="$flags -static"
fi
mkdir -p $BUILD
mkdir "$build"
cmake -B $BUILD -S src \
cmake -B "$build" -S ../src \
-DCMAKE_BUILD_TYPE="Release" \
-DASSET_PATH="assets/" \
-DCMAKE_C_FLAGS="$FLAGS" \
-DCMAKE_CXX_FLAGS="$FLAGS" \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN"
-DCMAKE_C_FLAGS="$flags" \
-DCMAKE_CXX_FLAGS="$flags" \
-DCMAKE_TOOLCHAIN_FILE="$toolchain"
make --no-print-directory -C $BUILD -j$(nproc)
make --no-print-directory -C "$build" -j"$(nproc)"
rm -rf $SNAPSHOT
mkdir $SNAPSHOT
rm -rf "$snapshot"
mkdir "$snapshot"
cp -r \
assets \
$BUILD/dragonblocks_client$DOTEXE \
$BUILD/dragonblocks_server$DOTEXE \
singleplayer$DOTSH \
LICENSE \
README.md \
$SNAPSHOT
"../assets" \
"$build/dragonblocks_client$dotexe" \
"$build/dragonblocks_server$dotexe" \
"../singleplayer$dotsh" \
"../LICENSE" \
"../README.md" \
"$snapshot"
rm -f $SNAPSHOT.zip
zip -r $SNAPSHOT.zip $SNAPSHOT/*
rm -f "$snapshot.zip"
zip -r "$snapshot.zip" "$snapshot"/*

View File

@ -1,15 +1,8 @@
execute_process(COMMAND git tag --points-at HEAD
execute_process(COMMAND git describe --tags
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if("${GIT_VERSION}" STREQUAL "")
execute_process(COMMAND git rev-parse --short HEAD
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
configure_file(
version.h.in
${BINARY_DIR}/version.h

View File

@ -1,19 +1,22 @@
#!/bin/bash
echo "Snapshot uploading temporarily disabled"
exit
set -e
VERSION=`git tag --points-at HEAD`
IS_RELEASE="1"
if [[ $VERSION = "" ]]; then
VERSION=`git rev-parse --short HEAD`
IS_RELEASE="0"
name="$(git describe --tags)"
path="@snapshot/dragonblocks_alpha-$name"
ref="$(git tag --points-at HEAD)"
release="1"
if [[ "$ref" == "" ]]; then
ref="$(git rev-parse --short HEAD)"
release="0"
fi
curl -f -i -X POST -H "Content-Type: multipart/form-data" \
-F "secret=$SECRET" \
-F "name=$VERSION" \
-F "is_release=$IS_RELEASE" \
-F "linux=@dragonblocks_alpha-$VERSION.zip" \
-F "win32=@dragonblocks_alpha-win32-$VERSION.zip" \
-F "win64=@dragonblocks_alpha-win64-$VERSION.zip" \
-F "name=$name" \
-F "ref=$ref" \
-F "release=$release" \
-F "Linux=$path.zip" \
-F "Win32=$path-win32.zip" \
-F "Win64=$path-win64.zip" \
https://elidragon.tk/dragonblocks_alpha/upload.php