Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/e2b-dev/E2B
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas committed Oct 24, 2024
2 parents 722b75e + d051dfd commit eac4592
Show file tree
Hide file tree
Showing 12 changed files with 1,425 additions and 96 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/publish_packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Test JS SDK

on:
workflow_call:
secrets:
E2B_API_KEY:
required: true
NPM_TOKEN:
required: true
PYPI_TOKEN:
required: true

permissions:
contents: write

jobs:
test:
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 }}
2 changes: 1 addition & 1 deletion .github/workflows/python_sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
run: poetry build

- name: Run tests
run: poetry run pytest -n 4 --verbose -x
run: poetry run pytest --verbose -x
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
76 changes: 6 additions & 70 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,79 +110,15 @@ jobs:
uses: ./.github/workflows/cli_tests.yml
secrets: inherit

release:
publish:
name: Publish
needs: [is_release, python-tests, js-tests, cli-tests]
if: always() && !contains(needs.*.result, 'failure') && 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 }}
if: (!cancelled()) && !contains(needs.*.result, 'failure') && needs.is_release.outputs.release == 'true'
uses: ./.github/workflows/publish_packages.yml
secrets: inherit

report-failure:
needs: [python-tests, js-tests, cli-tests, release]
needs: [python-tests, js-tests, cli-tests, publish]
if: failure()
name: Release Failed - Slack Notification
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_candidates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
working-directory: packages/python-sdk
run: |
poetry install
poetry run pytest -n 4 --verbose -x
poetry run pytest --verbose -x
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eac4592

Please sign in to comment.