diff --git a/VERSION b/VERSION deleted file mode 100644 index b8626c4..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/output/bb64.amd64 b/output/bb64.amd64 index 0ed8d1d..50d43c9 100755 Binary files a/output/bb64.amd64 and b/output/bb64.amd64 differ diff --git a/output/bb64.arm64 b/output/bb64.arm64 index 2f7dcd3..33b3016 100755 Binary files a/output/bb64.arm64 and b/output/bb64.arm64 differ diff --git a/publish.sh b/publish.sh index 9ffe979..6bcb2f5 100755 --- a/publish.sh +++ b/publish.sh @@ -12,15 +12,16 @@ set -e # Prints a message to the user. # Increment version -if [ ! -f VERSION ]; then - echo 1 > VERSION +if [ ! -f version.h ]; then + echo "version.h not found!" >&2 + exit 1 else - v=$(cat VERSION) + v=$(cat version.h | grep -o 'static const char \*VERSION = "[0-9.]*";' | cut -d'"' -f2) v=$((v+1)) - echo $v > VERSION + echo "Incrementing version from $v to $v" >&2 + echo "static const char *VERSION = \"$v\";" > version.h fi -VERSION=$(cat VERSION) -TAG="v$VERSION" +TAG="v$v" # Build binaries ./build.sh @@ -68,16 +69,16 @@ if [ -z "$RELEASE_ID" ]; then fi # Upload binaries -for BIN in bb64 bb64.arm64; do - if [ -f "$BIN" ]; then +for BIN in bb64.amd64 bb64.arm64; do + if [ -f "output/$BIN" ]; then curl -s -X POST "$API_URL/releases/$RELEASE_ID/assets?name=$BIN" \ -H "Content-Type: application/octet-stream" \ -H "Authorization: token $GITEA_TOKEN_DEPLOY" \ - --data-binary @"$BIN" + --data-binary @"output/$BIN" echo "Uploaded $BIN to release $TAG." fi done -echo "Published bb64 version $VERSION to $REPO_URL (tag $TAG) with binaries." +echo "Published bb64 version $v to $REPO_URL (tag $TAG) with binaries." diff --git a/version.h b/version.h index c7e4b7c..6aacc2c 100644 --- a/version.h +++ b/version.h @@ -1,2 +1 @@ -static const char *VERSION = "1"; - +static const char *VERSION = "2";