Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
chore: allow canary releases (#1139)
Jakub Dobrybffab4222600
diff --git a/.github/workflows/release_candidates.yml b/.github/workflows/release_candidates.ymlindex f2ec583a5..0e7cad52f 100644--- a/.github/workflows/release_candidates.yml+++ b/.github/workflows/release_candidates.yml@@ -7,6 +7,32 @@ on:- opened- reopened- synchronize+ workflow_dispatch:+ inputs:+ js-sdk:+ description: 'Release JS SDK'+ required: false+ default: false+ type: boolean+ python-sdk:+ description: 'Release Python SDK'+ required: false+ default: false+ type: boolean+ cli:+ description: 'Release CLI'+ required: false+ default: false+ type: boolean+ tag:+ description: 'Dist-tag (e.g. rc, beta, snapshot)'+ required: true+ type: string+ preid:+ description: 'Prerelease identifier (defaults to branch name if empty)'+ required: false+ default: ''+ type: stringpermissions:contents: write@@ -16,11 +42,30 @@ jobs:name: Release Candidateruns-on: ubuntu-latest+ env:+ IS_JS: ${{ contains(github.event.pull_request.labels.*.name, 'js-rc') || (github.event_name == 'workflow_dispatch' && github.event.inputs.js-sdk == 'true') }}+ IS_CLI: ${{ contains(github.event.pull_request.labels.*.name, 'cli-rc') || (github.event_name == 'workflow_dispatch' && github.event.inputs.cli == 'true') }}+ IS_PYTHON: ${{ contains(github.event.pull_request.labels.*.name, 'python-rc') || (github.event_name == 'workflow_dispatch' && github.event.inputs.python-sdk == 'true') }}+ PUBLISH_TAG: ${{ github.event.inputs.tag || 'rc' }}+steps:+ - name: Sanitize preid+ run: |+ RAW_PREID="${{ github.event.inputs.preid || github.head_ref || github.ref_name }}"+ echo "PREID=$(echo "$RAW_PREID" | sed 's/[^0-9A-Za-z-]/-/g')" >> "$GITHUB_ENV"++ - name: Block production tags+ if: ${{ github.event_name == 'workflow_dispatch' }}+ run: |+ if [ "${{ github.event.inputs.tag }}" = "latest" ]; then+ echo "::error::Publishing with the 'latest' tag is not allowed from this workflow. Use the Release workflow instead."+ exit 1+ fi+- name: Checkout Repouses: actions/checkout@v4with:- ref: ${{ github.head_ref }}+ ref: ${{ github.head_ref || github.ref }}- name: Parse .tool-versionsuses: wistia/[email protected]@@ -30,33 +75,33 @@ jobs:prefix: 'tool_version_'- uses: pnpm/action-setup@v4- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}+ if: ${{ env.IS_JS == 'true' || env.IS_CLI == 'true' }}with:version: '${{ env.TOOL_VERSION_PNPM }}'- name: Setup Node.jsuses: actions/setup-node@v4- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') || contains( github.event.pull_request.labels.*.name, 'python-rc') }}+ if: ${{ env.IS_JS == 'true' || env.IS_CLI == 'true' || env.IS_PYTHON == 'true' }}with:node-version: '${{ env.TOOL_VERSION_NODEJS }}'registry-url: https://registry.npmjs.orgcache: pnpm- name: Configure pnpm- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}+ if: ${{ env.IS_JS == 'true' || env.IS_CLI == 'true' }}run: |pnpm config set auto-install-peers truepnpm config set exclude-links-from-lockfile true- name: Set up Pythonuses: actions/setup-python@v4- if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}+ if: ${{ env.IS_PYTHON == 'true' }}with:python-version: '${{ env.TOOL_VERSION_PYTHON }}'- name: Install and configure Poetryuses: snok/install-poetry@v1- if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}+ if: ${{ env.IS_PYTHON == 'true' }}with:version: '${{ env.TOOL_VERSION_POETRY }}'virtualenvs-create: true@@ -64,7 +109,7 @@ jobs:installer-parallel: true- name: Test Python SDK- if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}+ if: ${{ env.IS_PYTHON == 'true' }}working-directory: packages/python-sdkrun: |poetry install@@ -73,7 +118,7 @@ jobs:E2B_API_KEY: ${{ secrets.E2B_API_KEY }}- name: Release Candidate- if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}+ if: ${{ env.IS_PYTHON == 'true' }}working-directory: packages/python-sdkrun: |poetry version prerelease@@ -83,13 +128,13 @@ jobs:PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}- name: Install JS dependencies- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}+ if: ${{ env.IS_JS == 'true' || env.IS_CLI == 'true' }}run: |pnpm install --frozen-lockfile- name: Test JS SDKworking-directory: packages/js-sdk- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') }}+ if: ${{ env.IS_JS == 'true' }}run: |pnpm run testenv:@@ -97,29 +142,29 @@ jobs:- name: Release JS Candidateworking-directory: packages/js-sdk- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') }}+ if: ${{ env.IS_JS == 'true' }}run: |- npm version prerelease --preid=${{ github.head_ref }}- npm publish --tag rc+ npm version prerelease --preid=${{ env.PREID }}+ npm publish --tag ${{ env.PUBLISH_TAG }}env:NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}- name: Install dependencies- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}+ if: ${{ env.IS_JS == 'true' || env.IS_CLI == 'true' }}run: |pnpm install --frozen-lockfile- name: Release CLI Candidateworking-directory: packages/cli- if: ${{ contains( github.event.pull_request.labels.*.name, 'cli-rc') }}+ if: ${{ env.IS_CLI == 'true' }}run: |- npm version prerelease --preid=${{ github.head_ref }}- npm publish --tag rc+ npm version prerelease --preid=${{ env.PREID }}+ npm publish --tag ${{ env.PUBLISH_TAG }}env:NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}- name: Commit new versions- if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') || contains( github.event.pull_request.labels.*.name, 'python-rc') }}+ if: ${{ env.IS_JS == 'true' || env.IS_CLI == 'true' || env.IS_PYTHON == 'true' }}run: |git config user.name "github-actions[bot]"git config user.email "github-actions[bot]@users.noreply.github.com"