Files
Evan Purkhiser 89c55f0d3d ci(installer): publish @sentry/ai to npm via craft (#185)
Add the Craft release pipeline so packages/installer can be published to
npm as @sentry/ai.

- .craft.yml configures a single npm target (public scoped access) with a
  tarball-name guard. There is deliberately no github target, so a release
  creates no git tags and no GitHub releases -- nothing repo-wide implying
  the skills/plugins are versioned by it.
- The release branch is scoped to `release-installer/<version>` via
  releaseBranchPrefix, so it reads as a package release. craft creates it
  during prepare and deletes it after publish, so it is transient.
- changelogPolicy is `simple` (matching sentry-javascript) and the
  changelog lives with the package at packages/installer/CHANGELOG.md. The
  entry is written by hand before releasing; `auto` would sweep this repo's
  skill-drift and plugin churn into the installer changelog.
- release.yml runs `craft prepare` via the Sentry release bot App token.
  It must be an App token rather than GITHUB_TOKEN so the pushed release
  branch triggers release-build.yml, which packs the tarball and uploads
  it as the SHA-named artifact Craft's GitHub provider expects.
- The package gains `files: ["dist", "CHANGELOG.md"]`, publishConfig.access
  public, and an explicit LICENSE so the published tarball is complete
  without relying on pnpm copying the root LICENSE.

Publishing runs from getsentry/publish after a team lead approves the
release issue; this repo only prepares the release and builds the artifact.
2026-06-17 15:14:05 -04:00

47 lines
1.5 KiB
YAML

# Runs `craft prepare`. Needs the App token, not GITHUB_TOKEN -- a branch pushed
# with GITHUB_TOKEN wouldn't trigger release-build.yml.
name: Release
on:
workflow_dispatch:
inputs:
version:
description: Version to release (or "auto")
required: false
force:
description: Force a release even when there are release-blockers (optional)
required: false
merge_target:
description: Target branch to merge into. Uses the default branch as a fallback (optional)
required: false
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-24.04
name: "Release a new version"
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0
- name: Prepare release
uses: getsentry/craft@acdb88019720182caf57293360d7cdc8db9e75ac # v2.26.10
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
merge_target: ${{ github.event.inputs.merge_target }}