95 lines
3.3 KiB
Bash
Executable File
95 lines
3.3 KiB
Bash
Executable File
#!/bin/bash
|
||
# release.sh — One-command release driver for gostations (modeled on grokkit)
|
||
# Usage: ./release.sh v2.0.0
|
||
#
|
||
# This will:
|
||
# - Create the git tag (so downstream CI/release can see it)
|
||
# - Help generate/update CHANGELOG (via grokkit if available)
|
||
# - Commit the changes
|
||
# - Push tag + commit
|
||
# - Print suggested Gitea release notes body
|
||
|
||
set -euo pipefail
|
||
|
||
VERSION="${1:-}"
|
||
|
||
if [[ -z "$VERSION" || ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
|
||
echo "❌ Usage: $0 vX.Y.Z"
|
||
echo " Example: $0 v2.0.0"
|
||
exit 1
|
||
fi
|
||
|
||
echo "🚀 Starting release process for gostations $VERSION..."
|
||
|
||
# Safety check: clean working tree
|
||
if [[ -n $(git status --porcelain) ]]; then
|
||
echo "❌ Working tree is dirty. Commit or stash changes first."
|
||
exit 1
|
||
fi
|
||
|
||
# Final human confirmation
|
||
echo ""
|
||
echo "This will:"
|
||
echo " 1. Create git tag $VERSION"
|
||
echo " 2. (If grokkit available) Run grokkit changelog + commit for CHANGELOG.md"
|
||
echo " 3. Push the commit + tag"
|
||
echo " 4. Print ready-to-paste text for the Gitea release page"
|
||
echo ""
|
||
read -p "Proceed with release $VERSION? (y/N) " -n 1 -r
|
||
echo
|
||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||
echo "Aborted."
|
||
exit 1
|
||
fi
|
||
|
||
# 1. Create the tag early (CI release workflow triggers on tag)
|
||
echo "🏷️ Creating tag $VERSION..."
|
||
git tag "$VERSION"
|
||
|
||
# 2. Changelog / release prep (best effort using grokkit if present on PATH)
|
||
if command -v grokkit >/dev/null 2>&1; then
|
||
echo "📝 Generating/updating CHANGELOG.md via grokkit..."
|
||
grokkit changelog --version "$VERSION" || echo "⚠️ grokkit changelog returned non-zero (continuing)"
|
||
|
||
if [[ -n $(git status --porcelain -- CHANGELOG.md) ]]; then
|
||
echo "📦 Committing changelog changes via grokkit..."
|
||
git add CHANGELOG.md
|
||
grokkit commit || echo "⚠️ grokkit commit may need manual follow-up"
|
||
fi
|
||
else
|
||
echo "ℹ️ grokkit not found on PATH. Skipping automated changelog."
|
||
echo " You can manually edit CHANGELOG.md before the next steps if desired."
|
||
echo " Then run: git add CHANGELOG.md && git commit -m 'chore(release): $VERSION'"
|
||
fi
|
||
|
||
# 3. Push (tag was created earlier; push any new commit + tags)
|
||
echo "📤 Pushing commit (if any) + tag..."
|
||
git push || true
|
||
git push --tags
|
||
|
||
# 4. Print nice release notes for Gitea
|
||
echo ""
|
||
echo "✅ Release $VERSION pushed!"
|
||
echo ""
|
||
echo "📋 Copy-paste the following into the Gitea release notes body:"
|
||
echo "------------------------------------------------------------"
|
||
make -s release-notes VERSION="$VERSION" || cat <<EOF
|
||
## gostations ${VERSION}
|
||
|
||
New major release: full modern TUI (Bubble Tea) is now the default.
|
||
|
||
- Two-stage UI: station browser → dedicated playback view (Winamp-inspired)
|
||
- Live stream metadata display
|
||
- Playback controls: skip, volume (↑/↓ + vertical bar), mute, play/pause, stop (returns to list)
|
||
- mpv JSON IPC for responsive controls + metadata (no terminal takeover)
|
||
- Favorites (★) management in both TUI and CLI (fav list/add/del [index])
|
||
- Server-side search on ENTER while filtering
|
||
- Legacy wmenu UI still available via --legacy (for now)
|
||
- All previous CLI subcommands (find, play, fav) preserved
|
||
|
||
See the commit history and updated README for details.
|
||
EOF
|
||
echo "------------------------------------------------------------"
|
||
echo ""
|
||
echo "🎉 Now go to Gitea and create the release using the tag $VERSION."
|
||
echo " The workflow will automatically build cross-platform assets and attach them." |