diff --git a/release.sh b/release.sh index 8443d48..2343726 100755 --- a/release.sh +++ b/release.sh @@ -1,30 +1,15 @@ #!/usr/bin/env bash -# Cut a release: bump package.json, tag, push, build+push image, create Gitea release. +# Cut a release: bump package.json, tag, push. +# Gitea Actions creates the release; Komodo builds & pushes the image via webhook. # Usage: ./release.sh [patch|minor|major] (default: patch) set -euo pipefail cd "$(dirname "$0")" BUMP="${1:-patch}" -GITEA_API="${GITEA_API:-https://tea.urania.dev/api/v1}" -REPO="${REPO:-urania/nadir-webui}" -: "${GITEA_TOKEN:?set GITEA_TOKEN (Gitea > Settings > Applications > token with repo scope)}" - [ -z "$(git status --porcelain)" ] || { echo "working tree dirty, commit first"; exit 1; } # bumps version in package.json AND creates commit + tag vX.Y.Z bun pm version "$BUMP" -VERSION=$(bun -e 'console.log(require("./package.json").version)') -TAG="v$VERSION" - git push --follow-tags -# build + push the multi-arch image at this version -./build.sh - -# create the Gitea release from the tag -curl -fsSL -X POST "$GITEA_API/repos/$REPO/releases" \ - -H "Authorization: token $GITEA_TOKEN" \ - -H "Content-Type: application/json" \ - -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}" >/dev/null - -echo "released $TAG" +echo "released v$(bun -e 'console.log(require("./package.json").version)')"