Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/post-discord.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 'Post Release to Discord'

# Manual trigger to (re)post release notes for a specific version.
# Use when the automatic Discord post was skipped (e.g. squash-merge history).

on:
workflow_dispatch:
inputs:
version:
description: 'Release tag to post (e.g. v0.25.15)'
required: true
previous_version:
description: 'Previous release tag (e.g. v0.25.12)'
required: true
dry_run:
description: 'Dry run — print notes without posting'
type: boolean
default: false

permissions: read-all

jobs:
post:
runs-on: ubuntu-latest
if: github.repository == 'protoLabsAI/protoCLI'
timeout-minutes: 5

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install dependencies
run: npm ci

- name: Post release notes to Discord
run: |
node scripts/rewrite-release-notes.mjs \
"${{ inputs.version }}" \
"${{ inputs.previous_version }}" \
${{ inputs.dry_run == true && '--dry-run' || '--post-discord' }}
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
DISCORD_RELEASE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@protolabsai/proto",
"version": "0.25.15",
"version": "0.25.16",
"publishConfig": {
"access": "public"
},
Expand All @@ -20,7 +20,7 @@
"url": "https://github.com/protoLabsAI/protoCLI/issues"
},
"config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.25.15"
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.25.16"
},
"scripts": {
"start": "cross-env node scripts/start.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@protolabs/proto",
"version": "0.25.15",
"version": "0.25.16",
"description": "proto",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,7 +37,7 @@
"dist"
],
"config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.25.15"
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.25.16"
},
"dependencies": {
"@agentclientprotocol/sdk": "^0.14.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qwen-code/qwen-code-core",
"version": "0.25.15",
"version": "0.25.16",
"description": "proto core",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qwen-code/qwen-code-test-utils",
"version": "0.25.15",
"version": "0.25.16",
"private": true,
"main": "src/index.ts",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/web-templates/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qwen-code/web-templates",
"version": "0.25.15",
"version": "0.25.16",
"description": "Web templates bundled as embeddable JS/CSS strings",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/webui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@qwen-code/webui",
"version": "0.25.15",
"version": "0.25.16",
"description": "Shared UI components for proto packages",
"type": "module",
"main": "./dist/index.cjs",
Expand Down
37 changes: 36 additions & 1 deletion scripts/rewrite-release-notes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ function getCommitsBetween(fromTag, toTag) {
.filter(Boolean);
}

/**
* Fallback: fetch commits from origin/dev that are reachable from fromTag but
* not yet on main. Used when dev→main is squash-merged (collapsing individual
* commits into a single "chore: release" commit that gets filtered out).
*/
function getCommitsFromDev(fromTag) {
const SEPARATOR = '<<<COMMIT>>>';
try {
const log = run(
`git log ${fromTag}..origin/dev --pretty=format:"${SEPARATOR}%s%n%b"`,
);
return log
.split(SEPARATOR)
.map((block) => block.trim())
.filter(Boolean);
} catch {
return [];
}
}

// ─── Prompt ──────────────────────────────────────────────────────────────────

const SYSTEM_PROMPT = `You are a technical writer for protoLabs, a developer tools company.
Expand Down Expand Up @@ -176,7 +196,22 @@ console.log(`Generating release notes: ${previousVersion} → ${version}`);
const commits = getCommitsBetween(previousVersion, version);
console.log(`Found ${commits.length} commits`);

const { prompt: userPrompt, filteredCount } = buildUserPrompt(version, previousVersion, commits);
let { prompt: userPrompt, filteredCount } = buildUserPrompt(version, previousVersion, commits);

// Fallback: when dev→main is squash-merged, the tag-to-tag range only contains
// "chore: release" commits. Try origin/dev which preserves the individual commits.
if (filteredCount === 0) {
console.log('No user-facing commits in tag range — checking origin/dev for squash-merged commits...');
const devCommits = getCommitsFromDev(previousVersion);
if (devCommits.length > 0) {
const devResult = buildUserPrompt(version, previousVersion, devCommits);
if (devResult.filteredCount > 0) {
console.log(`Found ${devResult.filteredCount} user-facing commits on origin/dev.`);
userPrompt = devResult.prompt;
filteredCount = devResult.filteredCount;
}
}
}

if (dryRun) {
console.log('\n── System Prompt ──\n', SYSTEM_PROMPT);
Expand Down
Loading