-
-
Notifications
You must be signed in to change notification settings - Fork 13
chore(release): adopt new release pipeline (App auth + CHANGELOG extract) #31
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 all commits
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,112 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| bump: | ||
| description: "Version bump type" | ||
| required: true | ||
| default: "patch" | ||
| type: choice | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
|
|
||
| concurrency: | ||
| group: release | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
|
|
||
| jobs: | ||
| release: | ||
| if: github.repository == 'bmad-code-org/bmad-module-creative-intelligence-suite' && github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Generate GitHub App token | ||
| id: app-token | ||
| 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 }} | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: ".nvmrc" | ||
| cache: "npm" | ||
|
|
||
| - name: Configure git user | ||
| 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 validation | ||
| run: npm test | ||
|
|
||
| - name: Bump version | ||
| run: | | ||
| npm version ${{ inputs.bump }} -m "chore(release): v%s [skip ci]" | ||
|
|
||
| - name: Capture new version | ||
| id: version | ||
| run: | | ||
| VERSION=$(node -p "require('./package.json').version") | ||
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
| echo "tag=v${VERSION}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Push version commit and tag | ||
| 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. In Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
|
|
||
| - name: Create GitHub Release | ||
| run: | | ||
| TAG="${{ steps.version.outputs.tag }}" | ||
| VERSION="${{ steps.version.outputs.version }}" | ||
| BODY=$(awk -v ver="$VERSION" ' | ||
| /^## v/ { if (found) exit; if (index($0, "## v" ver)) found=1; next } | ||
|
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. In Severity: low 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| found { print } | ||
| ' CHANGELOG.md) | ||
|
Comment on lines
+77
to
+80
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.
🛠️ Suggested tighter match- BODY=$(awk -v ver="$VERSION" '
- /^## v/ { if (found) exit; if (index($0, "## v" ver)) found=1; next }
- found { print }
- ' CHANGELOG.md)
+ BODY=$(awk -v ver="$VERSION" '
+ /^## v/ { if (found) exit; if ($0 ~ "^## v" ver "([^0-9].*)?$") found=1; next }
+ found { print }
+ ' CHANGELOG.md)This requires the character after the version to be non-numeric (space, dash, end-of-line), preventing 🤖 Prompt for AI Agents |
||
| if [ -z "$BODY" ]; then | ||
| echo "::error::No CHANGELOG.md entry found for $TAG. Add a '## v${VERSION} - DATE' section before releasing." | ||
| exit 1 | ||
| fi | ||
| gh release create "$TAG" \ | ||
| --title "Creative Intelligence Suite $TAG" \ | ||
| --notes "$BODY" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Comment on lines
+59
to
+89
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 validation runs after the tag is pushed — failure leaves an orphan tag on The Validate the CHANGELOG entry before mutating state — ideally before 🛠️ Suggested reorderingMove the CHANGELOG extraction to run after - name: Capture new version
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "tag=v${VERSION}" >> $GITHUB_OUTPUT
+ - name: Extract release notes from CHANGELOG
+ id: notes
+ run: |
+ VERSION="${{ steps.version.outputs.version }}"
+ TAG="${{ steps.version.outputs.tag }}"
+ BODY=$(awk -v ver="$VERSION" '
+ /^## v/ { if (found) exit; if (index($0, "## v" ver)) found=1; next }
+ found { print }
+ ' CHANGELOG.md)
+ if [ -z "$BODY" ]; then
+ echo "::error::No CHANGELOG.md entry found for $TAG. Add a '## v${VERSION} - DATE' section before releasing."
+ exit 1
+ fi
+ {
+ echo 'body<<EOF_NOTES'
+ printf '%s\n' "$BODY"
+ echo 'EOF_NOTES'
+ } >> $GITHUB_OUTPUT
- name: Push version commit and tag
run: git push origin main --follow-tagsThen consume 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Notify Discord | ||
| if: success() | ||
| continue-on-error: true | ||
| run: | | ||
| set -o pipefail | ||
| source .github/scripts/discord-helpers.sh | ||
| [ -z "$WEBHOOK" ] && exit 0 | ||
| TAG="${{ steps.version.outputs.tag }}" | ||
| RELEASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/${TAG}" | ||
| MSG=$(printf '🎨 **[Creative Intelligence Suite %s released](<%s>)**' "$TAG" "$RELEASE_URL" | esc) | ||
| jq -n --arg content "$MSG" '{content: $content}' | curl -sf --retry 2 -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- | ||
|
Comment on lines
+95
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: # Check the discord-helpers.sh file
cat -n .github/scripts/discord-helpers.sh | head -30Repository: bmad-code-org/bmad-module-creative-intelligence-suite Length of output: 1295 🏁 Script executed: # Also look for bmad-builder reference
grep -r "bmad-builder" . --max-count=5Repository: bmad-code-org/bmad-module-creative-intelligence-suite Length of output: 528 🏁 Script executed: # Get full context of the release workflow
sed -n '85,110p' .github/workflows/release.yamlRepository: bmad-code-org/bmad-module-creative-intelligence-suite Length of output: 1107 Discord message markdown is broken by piping the template through The Since 🛠️ Proposed fix- MSG=$(printf '🎨 **[Creative Intelligence Suite %s released](<%s>)**' "$TAG" "$RELEASE_URL" | esc)
+ MSG=$(printf '🎨 **[Creative Intelligence Suite %s released](<%s>)**' "$TAG" "$RELEASE_URL")🤖 Prompt for AI Agents |
||
| env: | ||
| WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
|
|
||
| - name: Summary | ||
| run: | | ||
| TAG="${{ steps.version.outputs.tag }}" | ||
| { | ||
| echo "## Released ${TAG}" | ||
| echo "" | ||
| echo "- **GitHub Release:** https://github.com/${{ github.repository }}/releases/tag/${TAG}" | ||
| } >> $GITHUB_STEP_SUMMARY | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
In
.github/workflows/release.yaml:11-14, the dispatchbumpoptions only allowpatch|minor|major, whereas the removed workflow (andpackage.jsonscripts) previously supported prerelease bumps. Confirm this restriction is intentional so you don’t lose the ability to cut alpha/beta-style releases if you still need them.Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.