-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (71 loc) · 2.73 KB
/
Copy pathrelease.yml
File metadata and controls
79 lines (71 loc) · 2.73 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
# release.yml — stitch-kit automated releases + npm publish
#
# Uses release-please to automate versioning based on conventional commits.
# How it works:
# 1. Every push to main is analyzed for conventional commits (feat, fix, etc.)
# 2. release-please opens a "Release PR" with the version bump + CHANGELOG update
# 3. When you merge the Release PR, it creates a GitHub release + tag automatically
# 4. If a release was created, publishes to npm via OIDC trusted publishing (no token)
#
# Version bump rules (from conventional commits):
# feat: → minor bump (1.3.0 → 1.4.0)
# fix: / chore: → patch bump (1.3.0 → 1.3.1)
# BREAKING CHANGE: → major bump (1.3.0 → 2.0.0)
#
# Files that get their version bumped automatically:
# - package.json (version field)
# - .claude-plugin/plugin.json (version field)
# - .claude-plugin/marketplace.json (metadata.version field)
#
# npm publishing uses OIDC trusted publishing — no NPM_TOKEN secret required.
# One-time setup on npmjs.com:
# 1. Go to https://www.npmjs.com/package/@booplex/stitch-kit/access
# 2. Under "Publishing access", click "Add trusted publisher"
# 3. Set: owner=gabelul, repo=stitch-kit, workflow=release.yml, environment=npm
#
# See release-please-config.json for full configuration.
name: Release
on:
push:
branches: [main]
workflow_dispatch:
inputs:
publish:
description: 'Force publish to npm (use when release exists but publish failed)'
type: boolean
default: false
permissions:
contents: write
pull-requests: write
jobs:
release-please:
name: Create or update release PR
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
publish-npm:
name: Publish to npm
needs: release-please
if: ${{ needs.release-please.outputs.release_created || (github.event_name == 'workflow_dispatch' && inputs.publish) }}
runs-on: ubuntu-latest
environment: npm
permissions:
contents: read
id-token: write # OIDC trusted publishing — no NPM_TOKEN needed
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
# OIDC trusted publishing requires npm 11.5.1+ for automatic auth exchange
- name: Update npm for OIDC support
run: npm install -g npm@latest
# Trusted publishing: OIDC handles auth, --provenance is automatic
- run: npm publish --provenance --access public