Skip to content

Commit ca41b93

Browse files
committed
ci: track real distribution channels in the Deployments dashboard
Record an npm deployment via the API after publish (keeps OIDC trusted publishing untouched — no environment: key, no npmjs.com change), and add native environments for the homebrew-tap and claude-marketplace jobs. The obsolete pypi environment was removed on GitHub.
1 parent e336d8e commit ca41b93

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ jobs:
180180
permissions:
181181
contents: read
182182
id-token: write # npm provenance / OIDC trusted publishing (tokenless)
183+
deployments: write # record an "npm" deployment for the Deployments dashboard
183184
steps:
184185
- uses: actions/checkout@v7
185186
with:
@@ -196,6 +197,25 @@ jobs:
196197
# no NODE_AUTH_TOKEN). Requires the GitHub trusted publisher registered
197198
# on npmjs.com for this repo + workflow file (environment left blank).
198199
- run: npm publish --access public
200+
# Surface npm in the repo's Deployments dashboard. Done via the API rather than a job-level
201+
# `environment:` key on purpose: an environment would change the OIDC subject claim and break
202+
# trusted publishing unless mirrored in npmjs.com's trusted-publisher settings.
203+
- name: Record npm deployment
204+
uses: actions/github-script@v8
205+
with:
206+
script: |
207+
const { version } = require(`${process.env.GITHUB_WORKSPACE}/package.json`);
208+
const common = { owner: context.repo.owner, repo: context.repo.repo };
209+
const dep = await github.rest.repos.createDeployment({
210+
...common, ref: context.sha, environment: 'npm',
211+
auto_merge: false, required_contexts: [],
212+
production_environment: true, description: 'Published to npm',
213+
});
214+
await github.rest.repos.createDeploymentStatus({
215+
...common, deployment_id: dep.data.id, state: 'success',
216+
environment_url: `https://www.npmjs.com/package/devcoach/v/${version}`,
217+
description: 'Published to npm',
218+
});
199219
200220
# ── GitHub Release with the signed .mcpb attached ──────────────────────────
201221
release:
@@ -254,6 +274,9 @@ jobs:
254274
needs: [publish, bump]
255275
if: ${{ always() && needs.publish.result == 'success' }}
256276
runs-on: ubuntu-latest
277+
environment:
278+
name: homebrew-tap
279+
url: https://github.com/UltimaPhoenix/homebrew-tap/blob/main/Formula/devcoach.rb
257280
env:
258281
TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
259282
steps:
@@ -285,6 +308,9 @@ jobs:
285308
needs: [publish, bump]
286309
if: ${{ always() && needs.publish.result == 'success' }}
287310
runs-on: ubuntu-latest
311+
environment:
312+
name: claude-marketplace
313+
url: https://github.com/UltimaPhoenix/claude-plugins-marketplace
288314
env:
289315
MARKETPLACE_TOKEN: ${{ secrets.CLAUDE_PLUGIN_MARKETPLACE }}
290316
steps:

0 commit comments

Comments
 (0)