From 2b8e0a63929894c26f13fe7fbeb483315ec925ce Mon Sep 17 00:00:00 2001 From: Steve Cliff Date: Thu, 12 Mar 2026 22:24:08 +0000 Subject: [PATCH] Release v1.0.1 --- VERSION | 2 +- publish.sh | 71 ++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/VERSION b/VERSION index afaf360..7dea76e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 \ No newline at end of file +1.0.1 diff --git a/publish.sh b/publish.sh index 6b014e9..0f3fc58 100755 --- a/publish.sh +++ b/publish.sh @@ -13,35 +13,54 @@ echo "Current version: $current" IFS='.' read -r major minor patch <<< "$current" -if [ "${1:-}" = "--increment" ]; then - patch=$((patch + 1)) - new_version="${major}.${minor}.${patch}" - echo "Auto-incrementing to: $new_version" -else - echo "Increment version? [y/N]" - read -r answer - if [[ "$answer" =~ ^[Yy] ]]; then - echo " 1) patch (${major}.${minor}.$((patch + 1)))" - echo " 2) minor (${major}.$((minor + 1)).0)" - echo " 3) major ($((major + 1)).0.0)" - echo -n "Choice [1]: " - read -r choice - case "${choice:-1}" in - 1) patch=$((patch + 1)); new_version="${major}.${minor}.${patch}" ;; - 2) minor=$((minor + 1)); patch=0; new_version="${major}.${minor}.${patch}" ;; - 3) major=$((major + 1)); minor=0; patch=0; new_version="${major}.${minor}.${patch}" ;; - *) echo "Invalid choice" >&2; exit 1 ;; - esac - echo "New version: $new_version" - else - new_version="$current" - echo "Keeping version: $new_version" - fi -fi +patch=$((patch + 1)) +new_version="${major}.${minor}.${patch}" +echo "New version: $new_version" echo "$new_version" > "$VERSION_FILE" echo "Building arrman v${new_version}..." go build -ldflags "-X main.Version=${new_version}" -o arrman . -echo "Done: ./arrman v${new_version}" +echo "Build successful: ./arrman v${new_version}" + +# --- Git commit & push --- +echo "" +echo "Committing changes..." +git add -A +if git diff --cached --quiet; then + echo "No changes to commit, skipping." +else + git commit -m "Release v${new_version}" + echo "Committed." +fi + +echo "Pushing to origin..." +git push origin main + +# --- Git tag --- +tag="v${new_version}" +echo "Creating tag ${tag}..." +git tag -a "${tag}" -m "Release ${tag}" +git push origin "${tag}" + +# --- Gitea release --- +echo "" +echo "Creating Gitea release..." + +# Generate release notes from git log since last tag +prev_tag=$(git tag --sort=-v:refname | grep -v "^${tag}$" | head -1 || true) +if [ -n "$prev_tag" ]; then + release_notes=$(git log --pretty=format:"- %s" "${prev_tag}..${tag}") +else + release_notes=$(git log --pretty=format:"- %s" "${tag}") +fi + +tea release create \ + --tag "${tag}" \ + --title "${tag}" \ + --note "$release_notes" \ + --asset ./arrman + +echo "" +echo "Done! Published arrman ${tag}"