cleanup
This commit is contained in:
+3
-18
@@ -1,30 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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)
|
# Usage: ./release.sh [patch|minor|major] (default: patch)
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
BUMP="${1:-patch}"
|
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; }
|
[ -z "$(git status --porcelain)" ] || { echo "working tree dirty, commit first"; exit 1; }
|
||||||
|
|
||||||
# bumps version in package.json AND creates commit + tag vX.Y.Z
|
# bumps version in package.json AND creates commit + tag vX.Y.Z
|
||||||
bun pm version "$BUMP"
|
bun pm version "$BUMP"
|
||||||
VERSION=$(bun -e 'console.log(require("./package.json").version)')
|
|
||||||
TAG="v$VERSION"
|
|
||||||
|
|
||||||
git push --follow-tags
|
git push --follow-tags
|
||||||
|
|
||||||
# build + push the multi-arch image at this version
|
echo "released v$(bun -e 'console.log(require("./package.json").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"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user