diff --git a/install.sh b/install.sh index 0e8ff96..bc7a292 100644 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ # 1. determines the architecture of the local machine -# 2. downloads the appropriate bb64 binary +# 2. downloads the appropriate bb64 binary from the latest public release on Gitea (https://gitea.jde.nz/j/bb64/releases) # 3. makes the bb64 binary executable diff --git a/publish.sh b/publish.sh index 6bcb2f5..cdf85dc 100755 --- a/publish.sh +++ b/publish.sh @@ -40,9 +40,13 @@ REPO=$(echo "$REPO_URL" | sed -E 's#.*/([^/]+)(\.git)?$#\1#') API_URL="$BASE_URL/api/v1/repos/$OWNER/$REPO" -# Check for GITEA_TOKEN -if [ -z "$GITEA_TOKEN_DEPLOY" ]; then - echo "GITEA_TOKEN_DEPLOY environment variable not set!" >&2 +# Check for GITEA_TOKEN_DEPLOY or GITEA_TOKEN +if [ -n "$GITEA_TOKEN_DEPLOY" ]; then + TOKEN="$GITEA_TOKEN_DEPLOY" +elif [ -n "$GITEA_TOKEN" ]; then + TOKEN="$GITEA_TOKEN" +else + echo "GITEA_TOKEN_DEPLOY or GITEA_TOKEN environment variable not set!" >&2 exit 1 fi @@ -60,7 +64,7 @@ EOF RELEASE_ID=$(curl -s -X POST "$API_URL/releases" \ -H "Content-Type: application/json" \ - -H "Authorization: token $GITEA_TOKEN_DEPLOY" \ + -H "Authorization: token $TOKEN" \ -d "$RELEASE_DATA" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) if [ -z "$RELEASE_ID" ]; then @@ -73,7 +77,7 @@ 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" \ + -H "Authorization: token $TOKEN" \ --data-binary @"output/$BIN" echo "Uploaded $BIN to release $TAG." fi diff --git a/version.h b/version.h index 6aacc2c..f0e18c9 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -static const char *VERSION = "2"; +static const char *VERSION = "5";