Skip to content

Commit 413ef00

Browse files
committed
chore: updates to release workflow
1 parent 27b9628 commit 413ef00

3 files changed

Lines changed: 83 additions & 30 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,22 @@ jobs:
223223
fi
224224
225225
- name: Install Claude Code
226-
run: npm install -g @anthropic-ai/claude-code
226+
run: |
227+
npm install -g @anthropic-ai/claude-code
228+
echo "Claude Code installed. Version:"
229+
claude --version
227230
228231
- name: Generate release notes
229232
env:
230233
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
231234
run: |
235+
# Verify API key is set
236+
if [ -z "$ANTHROPIC_API_KEY" ]; then
237+
echo "ERROR: ANTHROPIC_API_KEY is not set"
238+
exit 1
239+
fi
240+
echo "API key is set (length: ${#ANTHROPIC_API_KEY})"
241+
232242
PREV_TAG="${{ steps.prev-tag.outputs.tag }}"
233243
IS_MINOR="${{ steps.prev-tag.outputs.is_minor_bump }}"
234244
@@ -243,11 +253,20 @@ jobs:
243253
244254
Generate the release notes now. Output ONLY the markdown release notes, no preamble or explanation."
245255
246-
# Run Claude Code with the prompt (print mode outputs to stdout)
247-
claude -p "$PROMPT" > release_notes.md
256+
echo "Prompt length: ${#PROMPT} characters"
257+
echo "Running Claude Code..."
248258
249-
echo "Generated release notes:"
250-
cat release_notes.md
259+
# Run Claude Code - capture both stdout and stderr
260+
if claude -p "$PROMPT" > release_notes.md 2>&1; then
261+
echo "Success! Generated release notes:"
262+
cat release_notes.md
263+
else
264+
EXIT_CODE=$?
265+
echo "Claude Code failed with exit code $EXIT_CODE"
266+
echo "Output (if any):"
267+
cat release_notes.md || true
268+
exit $EXIT_CODE
269+
fi
251270
252271
- name: Upload release notes
253272
uses: actions/upload-artifact@v4

scripts/release-notes-template.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,21 @@ Start with:
6262

6363
- Bug fix description ([#PR_NUMBER](https://github.com/sequinstream/sequin/pull/PR_NUMBER))
6464

65+
## Writing style
66+
67+
- Write at a middle school reading level. Short sentences. Simple words.
68+
- Use active voice: "Adds support for X" not "Support for X has been added"
69+
- Cut filler words: no "very", "really", "actually", "basically", "simply", "just"
70+
- If a word adds no information, delete it
71+
- Lead with what changed, not why
72+
6573
## Rules
6674

6775
- Use Sentence case for headings (not Title Case)
6876
- Each bullet starts with a present-tense verb
6977
- Link to PRs for significant changes using format: ([#123](https://github.com/sequinstream/sequin/pull/123))
7078
- Link to relevant docs when a feature has documentation
7179
- Skip sections with no items (except breaking changes on minor bumps)
72-
- Be concise but informative
7380
- Don't include CI changes, dependency bumps, or internal refactors unless they affect users
7481
- If a commit message mentions "fix" or "bug", categorize under Fixed
7582
- If a commit adds new functionality, categorize under Added

scripts/tag-release.sh

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -72,38 +72,65 @@ if git rev-parse "$new_version" >/dev/null 2>&1; then
7272
fi
7373

7474
# Verify the commit has been signed off (via GitHub Actions check run)
75+
# Polls until signoff passes, fails, or times out
7576
echo ""
7677
echo "Verifying commit signoff..."
7778
COMMIT_SHA=$(git rev-parse origin/main)
79+
COMMIT_SHORT=$(git rev-parse --short origin/main)
80+
81+
MAX_ATTEMPTS=60 # 10 minutes max (60 * 10 seconds)
82+
ATTEMPT=1
83+
84+
while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do
85+
# GitHub Actions creates "check runs", not "commit statuses" - use the check-runs API
86+
CHECK_RUNS=$(gh api \
87+
-H "Accept: application/vnd.github+json" \
88+
-H "X-GitHub-Api-Version: 2022-11-28" \
89+
"/repos/sequinstream/sequin/commits/$COMMIT_SHA/check-runs" 2>/dev/null || echo '{"check_runs":[]}')
90+
91+
SIGNOFF_SUCCESS=$(echo "$CHECK_RUNS" | jq '[.check_runs[] | select(.name=="signoff" and .conclusion=="success")] | length')
92+
SIGNOFF_FAILED=$(echo "$CHECK_RUNS" | jq '[.check_runs[] | select(.name=="signoff" and .conclusion=="failure")] | length')
93+
SIGNOFF_PENDING=$(echo "$CHECK_RUNS" | jq '[.check_runs[] | select(.name=="signoff" and .status=="in_progress")] | length')
94+
SIGNOFF_QUEUED=$(echo "$CHECK_RUNS" | jq '[.check_runs[] | select(.name=="signoff" and .status=="queued")] | length')
95+
96+
if [ "$SIGNOFF_SUCCESS" -gt 0 ]; then
97+
echo -e "${GREEN}✓ Commit $COMMIT_SHORT has been signed off${RESET}"
98+
break
99+
elif [ "$SIGNOFF_FAILED" -gt 0 ]; then
100+
echo -e "${RED}✗ Signoff failed for commit $COMMIT_SHORT${RESET}"
101+
echo " Check the workflow run: https://github.com/sequinstream/sequin/commit/$COMMIT_SHA"
102+
exit 1
103+
elif [ "$SIGNOFF_PENDING" -gt 0 ] || [ "$SIGNOFF_QUEUED" -gt 0 ]; then
104+
if [ $ATTEMPT -eq 1 ]; then
105+
echo -e "${YELLOW}⏳ Signoff is running for commit $COMMIT_SHORT, waiting...${RESET}"
106+
fi
107+
printf "."
108+
sleep 10
109+
ATTEMPT=$((ATTEMPT + 1))
110+
else
111+
# No signoff check found yet - might not have started
112+
if [ $ATTEMPT -eq 1 ]; then
113+
echo -e "${YELLOW}⏳ Waiting for signoff workflow to start...${RESET}"
114+
fi
115+
printf "."
116+
sleep 10
117+
ATTEMPT=$((ATTEMPT + 1))
118+
fi
119+
done
78120

79-
# GitHub Actions creates "check runs", not "commit statuses" - use the check-runs API
80-
CHECK_RUNS=$(gh api \
81-
-H "Accept: application/vnd.github+json" \
82-
-H "X-GitHub-Api-Version: 2022-11-28" \
83-
"/repos/sequinstream/sequin/commits/$COMMIT_SHA/check-runs" 2>/dev/null || echo '{"check_runs":[]}')
84-
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')
88-
89-
if [ "$SIGNOFF_SUCCESS" -gt 0 ]; then
90-
echo -e "${GREEN}✓ Commit has been signed off${RESET}"
91-
elif [ "$SIGNOFF_PENDING" -gt 0 ] || [ "$SIGNOFF_QUEUED" -gt 0 ]; then
92-
echo -e "${YELLOW}⏳ Signoff is still running. Please wait for it to complete.${RESET}"
93-
echo " Check status at: https://github.com/sequinstream/sequin/commit/$COMMIT_SHA"
94-
exit 1
95-
else
96-
echo -e "${RED}✗ Commit has not been signed off.${RESET}"
121+
# Check if we exited the loop due to timeout
122+
if [ $ATTEMPT -gt $MAX_ATTEMPTS ]; then
97123
echo ""
98-
echo "This could mean:"
99-
echo " 1. The signoff workflow hasn't started yet (wait a moment)"
100-
echo " 2. The signoff workflow failed (check GitHub Actions)"
101-
echo " 3. This commit was never pushed to main"
102-
echo ""
103-
echo "Check status at: https://github.com/sequinstream/sequin/commit/$COMMIT_SHA"
124+
echo -e "${RED}✗ Timeout waiting for signoff (10 minutes)${RESET}"
125+
echo " Check status at: https://github.com/sequinstream/sequin/commit/$COMMIT_SHA"
104126
exit 1
105127
fi
106128

129+
# Add newline after dots
130+
if [ $ATTEMPT -gt 1 ]; then
131+
echo ""
132+
fi
133+
107134
# Show what will happen
108135
echo ""
109136
echo -e "${CYAN}This will:${RESET}"

0 commit comments

Comments
 (0)