Repository navigation
80 lines (71 loc) · 2.29 KB
/
Copy pathrelease-please.yml
File metadata and controls
80 lines (71 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Release Please - Automated versioning and npm publishing
#
# How it works:
# 1. Every push to main with conventional commits updates a "Release PR"
# 2. When you merge the Release PR, it:
# - Updates version in package.json
# - Updates CHANGELOG.md
# - Creates a GitHub Release with tag
# - Triggers the npm publish job below
#
# Commit message format:
# feat: add new feature → minor version bump
# fix: fix a bug → patch version bump
# feat!: breaking change → major version bump
# chore/docs: no version bump
#
# npm Publishing:
# Uses Trusted Publishing (OIDC) - no secrets needed!
# Configure at: https://www.npmjs.com/package/@verygoodplugins/mcp-{name}/access
name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: node
npm-publish:
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm test
# Trusted Publishing: No NPM_TOKEN needed!
- run: npm publish --access public --provenance
announce:
needs: [release-please, npm-publish]
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ubuntu-latest
steps:
- name: Post to Slack
if: ${{ vars.SLACK_WEBHOOK_URL }}
uses: slackapi/slack-github-action@v1
with:
webhook-url: ${{ vars.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "🚀 ${{ github.repository }} ${{ needs.release-please.outputs.tag_name }} released!\n\nhttps://github.com/${{ github.repository }}/releases/tag/${{ needs.release-please.outputs.tag_name }}"
}