name: Publish Latest on: workflow_dispatch: inputs: bump: description: "Version bump type" required: true default: "patch" type: choice options: - patch - minor - major concurrency: group: publish-latest permissions: id-token: write contents: write jobs: publish: if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" cache: "npm" registry-url: "https://registry.npmjs.org" - 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 tests run: npm test - name: Bump version run: 'npm version ${{ inputs.bump }} -m "chore(release): v%s [skip ci]"' - name: Publish to npm run: npm publish --tag latest --provenance env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Push version commit and tag run: git push origin main --follow-tags - name: Create GitHub Release run: | TAG="v$(node -p 'require("./package.json").version')" gh release create "$TAG" --generate-notes env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Notify Discord continue-on-error: true run: | set -o pipefail source .github/scripts/discord-helpers.sh [ -z "$WEBHOOK" ] && exit 0 VERSION=$(node -p 'require("./package.json").version') RELEASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/tag/v${VERSION}" MSG=$(printf '📦 **[bmad-method v%s released](<%s>)**' "$VERSION" "$RELEASE_URL" | esc) jq -n --arg content "$MSG" '{content: $content}' | curl -sf --retry 2 -X POST "$WEBHOOK" -H "Content-Type: application/json" -d @- env: WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}