-
Notifications
You must be signed in to change notification settings - Fork 18
91 lines (76 loc) · 2.74 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (76 loc) · 2.74 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
81
82
83
84
85
86
87
88
89
90
91
name: Release
# Consolidated workflow because npm Trusted Publishers only allows ONE
# (repo, workflow, environment) tuple per package — so stable + channel
# must share a single workflow file.
on:
workflow_dispatch:
inputs:
mode:
description: "Release mode"
required: true
type: choice
options:
- stable
- channel
channel:
description: "dist-tag for channel mode (kebab-case, e.g. mcp/plugin/advisor). Reserved: latest/beta/alpha/next/rc/canary/dev. Ignored when mode=stable."
required: false
type: string
# Serialize stable globally; serialize channel per dist-tag name.
concurrency:
group: release-${{ inputs.mode }}-${{ inputs.channel }}
cancel-in-progress: false
jobs:
publish-stable:
if: inputs.mode == 'stable'
name: publish stable to npm + tag
runs-on: ubuntu-latest
environment: production # Required Reviewers gate
permissions:
contents: write # push lightweight tag to origin
id-token: write # OIDC for npm Trusted Publishing + provenance
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
registry-url: "https://registry.npmjs.org/"
- name: Install gitleaks
run: |
set -euo pipefail
GITLEAKS_VERSION=8.21.2
curl -sSfL \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
| sudo tar -xz -C /usr/local/bin gitleaks
gitleaks version
- run: pnpm install --frozen-lockfile
- name: publish-stable
run: node tools/release/publish-stable.mjs
publish-channel:
if: inputs.mode == 'channel'
name: publish beta to npm
runs-on: ubuntu-latest
permissions:
contents: read # no tag, no Release; just publish
id-token: write # OIDC for npm Trusted Publishing + provenance
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: pnpm
registry-url: "https://registry.npmjs.org/"
- name: Install gitleaks
run: |
set -euo pipefail
GITLEAKS_VERSION=8.21.2
curl -sSfL \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
| sudo tar -xz -C /usr/local/bin gitleaks
gitleaks version
- run: pnpm install --frozen-lockfile
- name: publish-channel
run: node tools/release/publish-channel.mjs --channel "${{ inputs.channel }}"