Skip to content

Commit 27b9628

Browse files
committed
chore: updates/fixes to release flow
1 parent b08d9e8 commit 27b9628

2 files changed

Lines changed: 40 additions & 31 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ jobs:
243243
244244
Generate the release notes now. Output ONLY the markdown release notes, no preamble or explanation."
245245
246-
# Run Claude Code with the prompt
247-
claude -p "$PROMPT" --output-file release_notes.md
246+
# Run Claude Code with the prompt (print mode outputs to stdout)
247+
claude -p "$PROMPT" > release_notes.md
248248
249249
echo "Generated release notes:"
250250
cat release_notes.md

scripts/tag-release.sh

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,8 @@ RESET='\033[0m'
2626
# Set the working directory to the project root
2727
cd "$(dirname "$0")/.." || exit
2828

29-
# Check for uncommitted changes
30-
if [[ -n $(git status --porcelain) ]]; then
31-
echo -e "${RED}Error: You have uncommitted changes. Please commit or stash them first.${RESET}"
32-
git status --short
33-
exit 1
34-
fi
35-
36-
# Make sure we're on main branch
37-
current_branch=$(git branch --show-current)
38-
if [[ "$current_branch" != "main" ]]; then
39-
echo -e "${YELLOW}Warning: You're on branch '$current_branch', not 'main'.${RESET}"
40-
read -p "Continue anyway? [y/N] " continue_anyway
41-
if [[ ! "$continue_anyway" =~ ^[Yy]$ ]]; then
42-
echo "Aborted."
43-
exit 1
44-
fi
45-
fi
46-
4729
# Fetch latest from origin (main branch and tags)
30+
# Note: We always tag origin/main, so local branch/state doesn't matter
4831
echo "Fetching latest from origin..."
4932
git fetch origin main --tags
5033

@@ -88,21 +71,24 @@ if git rev-parse "$new_version" >/dev/null 2>&1; then
8871
exit 1
8972
fi
9073

91-
# Verify the commit has been signed off
74+
# Verify the commit has been signed off (via GitHub Actions check run)
9275
echo ""
9376
echo "Verifying commit signoff..."
9477
COMMIT_SHA=$(git rev-parse origin/main)
95-
SIGNOFF_STATUS=$(gh api \
78+
79+
# GitHub Actions creates "check runs", not "commit statuses" - use the check-runs API
80+
CHECK_RUNS=$(gh api \
9681
-H "Accept: application/vnd.github+json" \
9782
-H "X-GitHub-Api-Version: 2022-11-28" \
98-
"/repos/sequinstream/sequin/commits/$COMMIT_SHA/statuses" 2>/dev/null || echo "[]")
83+
"/repos/sequinstream/sequin/commits/$COMMIT_SHA/check-runs" 2>/dev/null || echo '{"check_runs":[]}')
9984

100-
SIGNOFF_SUCCESS=$(echo "$SIGNOFF_STATUS" | jq '[.[] | select(.context=="signoff" and .state=="success")] | length')
101-
SIGNOFF_PENDING=$(echo "$SIGNOFF_STATUS" | jq '[.[] | select(.context=="signoff" and .state=="pending")] | length')
85+
SIGNOFF_SUCCESS=$(echo "$CHECK_RUNS" | jq '[.check_runs[] | select(.name=="signoff" and .conclusion=="success")] | length')
86+
SIGNOFF_PENDING=$(echo "$CHECK_RUNS" | jq '[.check_runs[] | select(.name=="signoff" and .status=="in_progress")] | length')
87+
SIGNOFF_QUEUED=$(echo "$CHECK_RUNS" | jq '[.check_runs[] | select(.name=="signoff" and .status=="queued")] | length')
10288

10389
if [ "$SIGNOFF_SUCCESS" -gt 0 ]; then
10490
echo -e "${GREEN}✓ Commit has been signed off${RESET}"
105-
elif [ "$SIGNOFF_PENDING" -gt 0 ]; then
91+
elif [ "$SIGNOFF_PENDING" -gt 0 ] || [ "$SIGNOFF_QUEUED" -gt 0 ]; then
10692
echo -e "${YELLOW}⏳ Signoff is still running. Please wait for it to complete.${RESET}"
10793
echo " Check status at: https://github.com/sequinstream/sequin/commit/$COMMIT_SHA"
10894
exit 1
@@ -150,9 +136,32 @@ git push origin "$new_version"
150136
echo ""
151137
echo -e "${GREEN}Tag $new_version pushed successfully!${RESET}"
152138
echo ""
153-
echo "GitHub Actions release workflow has been triggered."
154-
echo "Watch progress at: https://github.com/sequinstream/sequin/actions"
155-
echo ""
156-
echo "Once complete, the release will be available at:"
157-
echo " https://github.com/sequinstream/sequin/releases/tag/$new_version"
139+
echo "Waiting for release workflow to start..."
140+
sleep 5
141+
142+
# Find and watch the release workflow run
143+
RUN_ID=$(gh run list --workflow=release.yml --limit 1 --json databaseId --jq '.[0].databaseId')
144+
145+
if [ -n "$RUN_ID" ]; then
146+
echo "Watching release workflow (run $RUN_ID)..."
147+
echo ""
148+
gh run watch "$RUN_ID"
149+
150+
# Check final status
151+
RUN_STATUS=$(gh run view "$RUN_ID" --json conclusion --jq '.conclusion')
152+
echo ""
153+
if [ "$RUN_STATUS" = "success" ]; then
154+
echo -e "${GREEN}Release workflow completed successfully!${RESET}"
155+
echo ""
156+
echo "Release available at:"
157+
echo " https://github.com/sequinstream/sequin/releases/tag/$new_version"
158+
else
159+
echo -e "${RED}Release workflow failed with status: $RUN_STATUS${RESET}"
160+
echo "Check the workflow run for details:"
161+
echo " https://github.com/sequinstream/sequin/actions/runs/$RUN_ID"
162+
fi
163+
else
164+
echo -e "${YELLOW}Could not find workflow run. Check manually:${RESET}"
165+
echo " https://github.com/sequinstream/sequin/actions"
166+
fi
158167

0 commit comments

Comments
 (0)