Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Move publishing to separate workflow

Jakub Novakf185b317e706
diff --git a/.github/workflows/publish_packages.yml b/.github/workflows/publish_packages.yml
new file mode 100644
index 000000000..468445979
--- /dev/null
+++ b/.github/workflows/publish_packages.yml
@@ -0,0 +1,89 @@
+name: Test JS SDK
+
+on:
+ workflow_call:
+ secrets:
+ E2B_API_KEY:
+ required: true
+ GITHUB_TOKEN:
+ required: true
+ NPM_TOKEN:
+ required: true
+ PYPI_TOKEN:
+ required: true
+
+permissions:
+ contents: read
+
+jobs:
+ test:
+ defaults:
+ run:
+ working-directory: ./packages/js-sdk
+ name: Build and test SDK
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout Repo
+ uses: actions/checkout@v3
+
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: "3.9"
+
+ - name: Install and configure Poetry
+ uses: snok/install-poetry@v1
+ with:
+ version: 1.5.1
+ virtualenvs-create: true
+ virtualenvs-in-project: true
+ installer-parallel: true
+
+ - uses: pnpm/action-setup@v3
+ with:
+ version: 9.5
+
+ - name: Setup Node.js 18
+ uses: actions/setup-node@v3
+ with:
+ node-version: '18.x'
+ cache: pnpm
+
+ - name: Configure pnpm
+ run: |
+ pnpm config set auto-install-peers true
+ pnpm config set exclude-links-from-lockfile true
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Create new versions
+ run: pnpm run version
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Release new versions
+ uses: changesets/action@v1
+ with:
+ publish: pnpm run publish
+ createGithubReleases: true
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
+
+ - name: Generate API Ref
+ run: pnpm run generate-api-reference
+
+ - name: Update lock file
+ run: pnpm i --no-link --no-frozen-lockfile
+
+ - name: Commit new versions
+ run: |
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git add apps/web/src/app/\(docs\)/docs/api-reference
+ git commit -am "[skip ci] Release new versions" || exit 0
+ git push
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release_pipeline.yml
similarity index 65%
rename from .github/workflows/release.yml
rename to .github/workflows/release_pipeline.yml
index 168d7de3a..57b19f7bc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release_pipeline.yml
@@ -111,75 +111,11 @@ jobs:
secrets: inherit
release:
+ name: Release
needs: [is_release, python-tests, js-tests, cli-tests]
if: !contains(needs.*.result, 'failure') && !cancelled() && needs.is_release.outputs.release == 'true'
- name: Release
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Repo
- uses: actions/checkout@v3
-
- - name: Set up Python
- uses: actions/setup-python@v4
- with:
- python-version: "3.9"
-
- - name: Install and configure Poetry
- uses: snok/install-poetry@v1
- with:
- version: 1.5.1
- virtualenvs-create: true
- virtualenvs-in-project: true
- installer-parallel: true
-
- - uses: pnpm/action-setup@v3
- with:
- version: 9.5
-
- - name: Setup Node.js 18
- uses: actions/setup-node@v3
- with:
- node-version: '18.x'
- cache: pnpm
-
- - name: Configure pnpm
- run: |
- pnpm config set auto-install-peers true
- pnpm config set exclude-links-from-lockfile true
-
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
-
- - name: Create new versions
- run: pnpm run version
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Release new versions
- uses: changesets/action@v1
- with:
- publish: pnpm run publish
- createGithubReleases: true
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
-
- - name: Generate API Ref
- run: pnpm run generate-api-reference
-
- - name: Update lock file
- run: pnpm i --no-link --no-frozen-lockfile
-
- - name: Commit new versions
- run: |
- git config user.name "github-actions[bot]"
- git config user.email "github-actions[bot]@users.noreply.github.com"
- git add apps/web/src/app/\(docs\)/docs/api-reference
- git commit -am "[skip ci] Release new versions" || exit 0
- git push
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ uses: ./.github/workflows/publish_packages.yml
+ secrets: inherit
report-failure:
needs: [python-tests, js-tests, cli-tests, release]