chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
name: Publish Candidates
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
js-sdk:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
python-sdk:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
cli:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
tag:
|
||||
required: true
|
||||
type: string
|
||||
preid:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish Release Candidates
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Parse .tool-versions
|
||||
uses: wistia/parse-tool-versions@v2.1.1
|
||||
with:
|
||||
filename: '.tool-versions'
|
||||
uppercase: 'true'
|
||||
prefix: 'tool_version_'
|
||||
|
||||
- uses: pnpm/action-setup@v4
|
||||
if: ${{ inputs.js-sdk || inputs.cli }}
|
||||
with:
|
||||
version: '${{ env.TOOL_VERSION_PNPM }}'
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
if: ${{ inputs.js-sdk || inputs.cli }}
|
||||
with:
|
||||
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
|
||||
registry-url: https://registry.npmjs.org
|
||||
cache: pnpm
|
||||
|
||||
- name: Configure pnpm
|
||||
if: ${{ inputs.js-sdk || inputs.cli }}
|
||||
run: |
|
||||
pnpm config set auto-install-peers true
|
||||
pnpm config set exclude-links-from-lockfile true
|
||||
|
||||
- name: Update npm
|
||||
if: ${{ inputs.js-sdk || inputs.cli }}
|
||||
run: |
|
||||
npm install -g npm@^11.6
|
||||
npm --version
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v6
|
||||
if: ${{ inputs.python-sdk }}
|
||||
with:
|
||||
version: '${{ env.TOOL_VERSION_UV }}'
|
||||
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
|
||||
enable-cache: true
|
||||
|
||||
- name: Publish Python RC
|
||||
if: ${{ inputs.python-sdk }}
|
||||
working-directory: packages/python-sdk
|
||||
run: |
|
||||
BASE_VERSION=$(uv version --short)
|
||||
uv version "${BASE_VERSION}rc${{ github.run_id }}"
|
||||
uv build
|
||||
uv publish --token ${PYPI_TOKEN} --check-url https://pypi.org/simple/
|
||||
env:
|
||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||
|
||||
- name: Install JS dependencies
|
||||
if: ${{ inputs.js-sdk || inputs.cli }}
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Publish JS RC
|
||||
if: ${{ inputs.js-sdk }}
|
||||
working-directory: packages/js-sdk
|
||||
env:
|
||||
RC_PREID: ${{ inputs.preid }}
|
||||
RC_TAG: ${{ inputs.tag }}
|
||||
run: |
|
||||
npm version prerelease --preid="${RC_PREID}.${{ github.run_id }}" --no-git-tag-version
|
||||
npm publish --tag "$RC_TAG" --provenance
|
||||
|
||||
- name: Reinstall dependencies
|
||||
if: ${{ inputs.js-sdk || inputs.cli }}
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Publish CLI RC
|
||||
if: ${{ inputs.cli }}
|
||||
working-directory: packages/cli
|
||||
env:
|
||||
RC_PREID: ${{ inputs.preid }}
|
||||
RC_TAG: ${{ inputs.tag }}
|
||||
run: |
|
||||
npm version prerelease --preid="${RC_PREID}.${{ github.run_id }}" --no-git-tag-version
|
||||
npm publish --tag "$RC_TAG" --provenance
|
||||
Reference in New Issue
Block a user