| name | GitHub Actions Release Workflow |
|---|---|
| overview | Phased approach - Phase 1 creates manual push-button workflow, Phase 2 (later) adds Positron dispatch trigger after CI is proven stable. |
| Phase | Scope | Risk | When |
|-------|-------|------|------|
| Phase 1 | Manual trigger only (workflow_dispatch) | Low | Now |
| Phase 2 | Add Positron dispatch trigger | Medium | After Phase 1 is stable |
This approach lets you iterate on the CI workflow without touching the Positron repo until you're confident it works.
sequenceDiagram
participant Dev as Developer
participant GH as GitHub Actions UI
participant PKG as positron-api-pkg
participant POS as Positron Repo
participant NPM as npm Registry
Dev->>GH: Click "Run workflow"
Dev->>GH: Select version_type, dry_run
GH->>PKG: Checkout this repo
PKG->>POS: Shallow clone positron-dts/ + product.json
PKG->>PKG: Run build.js
PKG->>PKG: Run tests
PKG->>PKG: Bump version
PKG->>NPM: npm publish
PKG->>GH: Create GitHub Release
Trigger: workflow_dispatch only (manual via GitHub Actions UI)
Inputs:
| Input | Type | Default | Description |
|-------|------|---------|-------------|
| version_type | choice | patch | Version bump type (patch/minor/major) |
| positron_ref | string | main | Positron branch/tag to build against |
| dry_run | boolean | false | Test run - builds but skips publish |
Steps:
- Checkout this repository
- Shallow clone Positron repo (depth=1, only needed files)
- Set up Node.js 20
- Install dependencies
- Run
npm run build - Run
npm run test:coverage - Bump version via
npm version $type --no-git-tag-version - Update README compatibility table
- Commit changes with bot identity
- Publish to npm (skip if dry_run)
- Create git tag and GitHub Release
Key Implementation Details:
- Uses shallow clone (
--depth 1) instead of sparse checkout for simplicity and reliability - Clones Positron to
../positronrelative to workspace (matchesbuild.jsexpectations) - Reads Positron version from
product.jsonautomatically - Configures git with
github-actions[bot]identity - Uses
GITHUB_TOKEN(automatic) for commits/releases - Uses
NPM_TOKEN(secret) for npm publish
- Go to npmjs.com and sign in
- Click profile icon -> Access Tokens
- Generate New Token -> Classic Token -> Automation
- Copy the token
- In GitHub: Repository Settings -> Secrets and variables -> Actions
- Click "New repository secret"
- Name:
NPM_TOKEN, Value: (paste token)
-
Go to repository on GitHub
-
Click Actions tab
-
Select Release workflow in sidebar
-
Click Run workflow dropdown
-
Select options:
version_type: patch (default), minor, or majorpositron_ref: main (or specific tag like2025.07.0)dry_run: check to test without publishing
-
Click Run workflow
Once Phase 1 is stable, add automatic triggering from Positron releases.
Add repository_dispatch to the existing on: block (3 lines):
on:
repository_dispatch:
types: [positron-release]
workflow_dispatch:
# ... existing inputs unchangedAdd logic to extract version from dispatch payload:
env:
POSITRON_VERSION: ${{ github.event.client_payload.positron_version || '' }}Add this step to Positron's release workflow:
- name: Trigger positron-api-pkg release
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.POSITRON_API_PKG_PAT }}
repository: posit-dev/positron-api-pkg
event-type: positron-release
client-payload: '{"positron_version": "${{ env.POSITRON_VERSION }}", "ref": "${{ github.ref }}"}'Required Secret in Positron repo: POSITRON_API_PKG_PAT - a Personal Access Token with repo scope for cross-repo dispatch.
NPM_TOKEN: Required secret for npm publish (Automation token type)GITHUB_TOKEN: Automatic, used for commits and releases (scoped to this repo)- Phase 2 only: PAT with
reposcope in Positron repo for cross-repo dispatch