Repository navigation
66 lines (55 loc) · 1.61 KB
/
Copy pathpublish.yml
File metadata and controls
66 lines (55 loc) · 1.61 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
name: Publish to npm
on:
workflow_dispatch:
inputs:
version:
description: 'Version bump'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm ci
- run: npm run build
- name: CLI smoke
run: node dist/cli.js platforms > /dev/null
- name: MCP smoke
run: node scripts/mcp-smoke.mjs
- name: Bump version and tag
if: github.event_name == 'workflow_dispatch'
run: |
git config user.name "exportcomments-bot"
git config user.email "support@exportcomments.com"
npm version ${{ inputs.version }} -m "chore: release v%s"
git push --follow-tags
- name: Resolve release tag
id: tag
run: |
VERSION=$(node -p "require('./package.json').version")
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
- name: Publish to npm (with provenance)
run: npm publish --provenance --access public
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ steps.tag.outputs.tag }}" --generate-notes --verify-tag --title "${{ steps.tag.outputs.tag }}"