Files
copilotkit__copilotkit/.github/workflows/prerelease.yml
Jordan Ritter 770759a4be fix(ci): separate build and publish jobs in release workflows
Build and publish now run in isolated GitHub Actions jobs. NPM_TOKEN
is only available in the publish job, preventing /proc/mem token
extraction from build-time code.
2026-05-11 16:08:53 -07:00

111 lines
2.6 KiB
YAML

name: release / pre
on:
workflow_dispatch:
inputs:
scope:
description: "What to release"
required: true
type: choice
options:
- monorepo
- angular
suffix:
description: "Version suffix (e.g. 'fix-user-issue'). Leave blank for timestamp."
required: false
type: string
dry_run:
description: "Dry run (don't actually publish)"
required: false
default: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
NX_VERBOSE_LOGGING: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "10.13.1"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm run build
- name: Run tests
run: pnpm run test
- name: Upload workspace
uses: actions/upload-artifact@v4
with:
name: workspace
path: .
include-hidden-files: true
retention-days: 1
publish:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "10.13.1"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Configure npm auth
run: |
npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish prerelease
run: |
ARGS="--scope ${{ inputs.scope }}"
if [ -n "${{ inputs.suffix }}" ]; then
ARGS="$ARGS --suffix ${{ inputs.suffix }}"
fi
if [ "${{ inputs.dry_run }}" == "true" ]; then
ARGS="$ARGS --dry-run"
fi
pnpm tsx scripts/release/prerelease.ts $ARGS
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}