Files
copilotkit__copilotkit/.github/workflows/prerelease.yml
2026-05-21 14:13:52 -07:00

125 lines
3.5 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
permissions:
contents: read
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:
# No credential persistence needed: the build job only reads source.
# Keeping credentials out of the artifact avoids leaking tokens.
- name: Checkout Repo
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Setup pnpm
# Omit `version:` so pnpm/action-setup inherits from the repo's
# `packageManager` field in package.json (via corepack).
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22.x
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Bump prerelease versions
env:
INPUT_SCOPE: ${{ inputs.scope }}
INPUT_SUFFIX: ${{ inputs.suffix }}
run: |
ARGS="--scope $INPUT_SCOPE"
if [ -n "$INPUT_SUFFIX" ]; then
ARGS="$ARGS --suffix $INPUT_SUFFIX"
fi
pnpm tsx scripts/release/bump-prerelease.ts $ARGS
- name: Build packages
run: pnpm run build
- name: Run tests
run: pnpm run test
- name: Upload workspace
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: workspace
path: .
include-hidden-files: true
retention-days: 1
publish:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 20
environment: npm
permissions:
contents: read
id-token: write
steps:
- name: Download workspace
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: workspace
- name: Setup pnpm
# Omit `version:` so pnpm/action-setup inherits from the repo's
# `packageManager` field in package.json (via corepack).
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 22.x
registry-url: https://registry.npmjs.org
- name: Publish prerelease
env:
NODE_AUTH_TOKEN: ""
INPUT_SCOPE: ${{ inputs.scope }}
INPUT_SUFFIX: ${{ inputs.suffix }}
INPUT_DRY_RUN: ${{ inputs.dry_run }}
run: |
ARGS="--scope $INPUT_SCOPE"
if [ -n "$INPUT_SUFFIX" ]; then
ARGS="$ARGS --suffix $INPUT_SUFFIX"
fi
if [ "$INPUT_DRY_RUN" == "true" ]; then
ARGS="$ARGS --dry-run"
fi
pnpm tsx scripts/release/prerelease.ts $ARGS