-
-
Notifications
You must be signed in to change notification settings - Fork 18
chore: update publish #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,167 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Publish | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "src/**" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "package.json" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - "package-lock.json" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inputs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| channel: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: "Publish channel" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: "latest" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: choice | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - next | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bump: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description: "Version bump type (latest channel only)" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| required: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| default: "patch" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| type: choice | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - patch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - minor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - major | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| concurrency: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group: publish | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cancel-in-progress: ${{ github.event_name == 'push' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Comment on lines
+30
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Push events can cancel an in-progress stable release.
Consider either separating the groups by channel or never cancelling when a
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| publish: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.repository == 'bmad-code-org/bmad-method-test-architecture-enterprise' && (github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Generate GitHub App token | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id: app-token | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/create-github-app-token@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| app-id: ${{ secrets.RELEASE_APP_ID }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Setup Node | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version-file: ".nvmrc" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache: "npm" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Ensure trusted publishing toolchain | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # npm trusted publishing requires modern npm on the runner. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| npm install --global npm@11.6.2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Configure git user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git config user.name "github-actions[bot]" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm ci | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm test | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Derive next prerelease version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.channel == 'next') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NEXT_VER=$(npm view bmad-method-test-architecture-enterprise@next version 2>/dev/null || echo "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| LATEST_VER=$(npm view bmad-method-test-architecture-enterprise@latest version 2>/dev/null || echo "") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BASE=$(node -e " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const semver = require('semver'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const next = process.argv[1] || null; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const latest = process.argv[2] || null; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!next && !latest) process.exit(0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!next) { console.log(latest); process.exit(0); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!latest) { console.log(next); process.exit(0); } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const nextBase = next.replace(/-next\.\d+$/, ''); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log(semver.gt(latest, nextBase) ? latest : next); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| " "$NEXT_VER" "$LATEST_VER") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -n "$BASE" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| npm version "$BASE" --no-git-tag-version --allow-same-version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| npm version prerelease --preid=next --no-git-tag-version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+81
to
+101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify semver comparison logic
# Check if 1.13.1-next.6 < 1.13.1
python3 <<'EOF'
import subprocess
import json
# Test semver comparisons in Node.js
test_script = """
const semver = require('semver');
// Test 1: Is 1.13.1-next.6 less than 1.13.1?
console.log('1.13.1-next.6 < 1.13.1:', semver.lt('1.13.1-next.6', '1.13.1'));
// Test 2: Verify gt vs gte with equal versions
const latest = '1.13.1';
const nextBase = '1.13.1';
console.log('semver.gt("1.13.1", "1.13.1"):', semver.gt(latest, nextBase));
console.log('semver.gte("1.13.1", "1.13.1"):', semver.gte(latest, nextBase));
// Test 3: Verify the logic flow when latest equals nextBase
if (!semver.gt(latest, nextBase)) {
console.log('With gt: BASE would be set to next (1.13.1-next.5)');
}
if (semver.gte(latest, nextBase)) {
console.log('With gte: BASE would be set to latest (1.13.1)');
}
// Test 4: Check other comparisons
console.log('semver.gt("1.13.2", "1.13.1"):', semver.gt('1.13.2', '1.13.1'));
console.log('semver.lt("1.13.0", "1.13.1"):', semver.lt('1.13.0', '1.13.1'));
"""
console.log("=== Testing semver comparison logic ===")
print(test_script)
EOFRepository: bmad-code-org/bmad-method-test-architecture-enterprise Length of output: 212 🏁 Script executed: #!/bin/bash
# Run the semver tests
node -e "
const semver = require('semver');
console.log('=== Semver Comparison Tests ===');
console.log('');
// Test 1: Is prerelease older than stable?
console.log('Test 1: Prerelease vs stable');
console.log('semver.lt(\"1.13.1-next.6\", \"1.13.1\"):', semver.lt('1.13.1-next.6', '1.13.1'));
console.log('');
// Test 2: gt vs gte with equal base versions
console.log('Test 2: gt vs gte comparison');
const latest = '1.13.1';
const nextBase = '1.13.1';
console.log('semver.gt(\"' + latest + '\", \"' + nextBase + '\"):', semver.gt(latest, nextBase));
console.log('semver.gte(\"' + latest + '\", \"' + nextBase + '\"):', semver.gte(latest, nextBase));
console.log('');
// Test 3: Impact on BASE selection
console.log('Test 3: Impact on BASE selection logic');
console.log('When latest=\"1.13.1\" and nextBase=\"1.13.1\":');
console.log(' gt(latest, nextBase) returns:', semver.gt(latest, nextBase), '-> BASE would be next');
console.log(' gte(latest, nextBase) returns:', semver.gte(latest, nextBase), '-> BASE would be latest');
"Repository: bmad-code-org/bmad-method-test-architecture-enterprise Length of output: 949 🏁 Script executed: #!/bin/bash
# Test npm version prerelease behavior
# We'll create a test to understand the behavior
npm --version
node -e "console.log('Node:', process.version)"
# Create a temporary directory to test npm version behavior
TMPDIR=$(mktemp -d)
cd "$TMPDIR"
# Initialize a test package
npm init -y > /dev/null 2>&1
echo "=== Testing npm version prerelease behavior ==="
echo ""
# Test 1: Starting from a stable version
echo "Test 1: npm version prerelease --preid=next on a clean stable"
npm pkg set version="1.13.1"
npm version prerelease --preid=next --no-git-tag-version 2>&1 | grep -oP '(?<=>)[^<]+' || npm pkg get version
# Test 2: Starting from a prerelease
npm pkg set version="1.13.1-next.5"
echo ""
echo "Test 2: npm version prerelease --preid=next on 1.13.1-next.5"
npm version prerelease --preid=next --no-git-tag-version 2>&1 | grep -oP '(?<=>)[^<]+' || npm pkg get version
# Clean up
cd /
rm -rf "$TMPDIR"Repository: bmad-code-org/bmad-method-test-architecture-enterprise Length of output: 325 🏁 Script executed: #!/bin/bash
# Simpler test for npm version behavior
TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
cd "$TMPDIR"
npm init -y > /dev/null 2>&1
echo "=== npm version prerelease Tests ==="
echo ""
# Test 1: Clean stable to prerelease
echo "Test 1: From clean stable (1.13.1) to prerelease"
npm pkg set version="1.13.1"
echo "Before: $(npm pkg get version)"
npm version prerelease --preid=next --no-git-tag-version > /dev/null 2>&1
echo "After prerelease: $(npm pkg get version)"
echo ""
# Test 2: From prerelease to next prerelease
npm pkg set version="1.13.1-next.5"
echo "Test 2: From prerelease (1.13.1-next.5) to next prerelease"
echo "Before: $(npm pkg get version)"
npm version prerelease --preid=next --no-git-tag-version > /dev/null 2>&1
echo "After prerelease: $(npm pkg get version)"
echo ""
# Test 3: From 1.13.2-next.0 (simulating after patch bump)
npm pkg set version="1.13.2-next.0"
echo "Test 3: From patch-bumped prerelease (1.13.2-next.0)"
echo "Before: $(npm pkg get version)"
npm version prerelease --preid=next --no-git-tag-version > /dev/null 2>&1
echo "After prerelease: $(npm pkg get version)"Repository: bmad-code-org/bmad-method-test-architecture-enterprise Length of output: 465 🏁 Script executed: npm install semver --no-save && node -e "
const semver = require('semver');
console.log('=== Semver Comparison Verification ===');
console.log('');
// Core claim: prerelease is older than stable
console.log('Prerelease ordering:');
console.log('semver.lt(\"1.13.1-next.6\", \"1.13.1\"):', semver.lt('1.13.1-next.6', '1.13.1'));
console.log('');
// Test the specific condition: gt vs gte when versions are equal
console.log('Comparison when latest == nextBase:');
const latest = '1.13.1';
const nextBase = '1.13.1';
console.log('latest=\"' + latest + '\", nextBase=\"' + nextBase + '\"');
console.log('semver.gt(latest, nextBase):', semver.gt(latest, nextBase), '-> BASE would be: next');
console.log('semver.gte(latest, nextBase):', semver.gte(latest, nextBase), '-> BASE would be: latest');
console.log('');
// Show impact: what happens with each choice
console.log('Impact analysis:');
console.log('If BASE=next (gt returns false):');
console.log(' Starting: 1.13.1-next.5');
console.log(' After npm version prerelease --preid=next: 1.13.1-next.6');
console.log(' Semver comparison: 1.13.1-next.6 < 1.13.1:', semver.lt('1.13.1-next.6', '1.13.1'));
console.log('');
console.log('If BASE=latest (gte returns true):');
console.log(' Starting: 1.13.1');
console.log(' After npm version prerelease --preid=next: 1.13.2-next.0');
console.log(' Semver comparison: 1.13.2-next.0 >= 1.13.1:', semver.gte('1.13.2-next.0', '1.13.1'));
"Repository: bmad-code-org/bmad-method-test-architecture-enterprise Length of output: 3284 Change When Using Suggested change
Suggested change
Note: when 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Bump stable version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm version "${{ inputs.bump }}" --no-git-tag-version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Sync marketplace version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node <<'NODE' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const fs = require('node:fs'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const marketplacePath = '.claude-plugin/marketplace.json'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const marketplace = JSON.parse(fs.readFileSync(marketplacePath, 'utf8')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const plugin = (marketplace.plugins || []).find((entry) => entry && entry.name === packageJson.name); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!plugin) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error(`Marketplace entry not found for ${packageJson.name}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plugin.version = packageJson.version; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fs.writeFileSync(marketplacePath, `${JSON.stringify(marketplace, null, 2)}\n`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NODE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Validate release metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm run test:release-metadata | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Publish prerelease to npm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.channel == 'next') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm publish --tag next --provenance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Publish stable release to npm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: npm publish --tag latest --provenance | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The stable path publishes to npm before the version bump commit/tag is created and pushed; if the later git push/tag/release steps fail, npm can contain a version that isn’t represented in git and reruns may hit “version already exists”. Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Commit version bump | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VERSION=$(node -p 'require("./package.json").version') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git add package.json package-lock.json .claude-plugin/marketplace.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git commit -m "release: bump to v${VERSION}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git tag -a "v${VERSION}" -m "Release v${VERSION}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Push version commit and tag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: git push origin main --follow-tags | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stable publish happens before the git push — failure leaves npm ahead of For the
If step 3 fails (branch protection, missing app permissions, race with another push, etc.), the version is already live on npm with no corresponding commit/tag on Prefer committing, tagging, and pushing first, then publishing to npm. The 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Create GitHub Release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'workflow_dispatch' && inputs.channel == 'latest' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TAG="v$(node -p 'require("./package.json").version')" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VERSION="${TAG#v}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BODY=$(awk -v ver="$VERSION" ' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /^## / { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (found) exit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if ($0 ~ "^## \\[" ver "\\]" || $0 ~ "^## v" ver) found=1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| next | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| found { print } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ' CHANGELOG.md) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -z "$BODY" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::warning::No CHANGELOG.md entry for $TAG — falling back to auto-generated notes" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gh release create "$TAG" --generate-notes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gh release create "$TAG" --notes "$BODY" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+153
to
+166
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CHANGELOG header matcher is narrow. The awk pattern matches only Consider broadening the pattern, or at minimum documenting the required header format in 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stable release commit will re-trigger the workflow as a
nextprerelease.The
pushtrigger watchespackage.jsonandpackage-lock.json. After alatestrun commits the version bump and pushes tomain(line 145), the resulting push matches this filter and spawns a new run that goes down the prerelease path — immediately publishing e.g.1.13.2-next.0right after1.13.2stable. If that’s intentional (auto‑resumenexttrack), consider documenting it; otherwise, guard the push trigger to skip release commits, e.g. by checking the commit author/message in the jobif, or use[skip ci]in the commit message on line 140.🤖 Prompt for AI Agents