Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Split Release action into multiple jobs

Jakub Novakd1c6854e9bf1
diff --git a/.github/workflows/cli_tests.yml b/.github/workflows/cli_tests.yml
index eb5ec4ab0..4f0f00eb5 100644
--- a/.github/workflows/cli_tests.yml
+++ b/.github/workflows/cli_tests.yml
@@ -5,6 +5,7 @@ on:
paths:
- packages/cli/**/*
- .github/workflows/cli_tests.yml
+ workflow_call:
permissions:
contents: read
@@ -19,9 +20,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
-
+
- uses: pnpm/action-setup@v2
-
+
- name: Setup Node
uses: actions/setup-node@v3
with:
diff --git a/.github/workflows/js_sdk_tests.yml b/.github/workflows/js_sdk_tests.yml
index 86c2f0942..39440f422 100644
--- a/.github/workflows/js_sdk_tests.yml
+++ b/.github/workflows/js_sdk_tests.yml
@@ -9,6 +9,10 @@ on:
paths:
- packages/js-sdk/**/*
- .github/workflows/js_sdk_tests.yml
+ workflow_call:
+ secrets:
+ E2B_API_KEY:
+ - required: true
permissions:
contents: read
@@ -23,8 +27,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
-
- - uses: pnpm/action-setup@v2
+
+ - uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v3
diff --git a/.github/workflows/python_sdk_tests.yml b/.github/workflows/python_sdk_tests.yml
index 5d9e9eef5..efd7814d2 100644
--- a/.github/workflows/python_sdk_tests.yml
+++ b/.github/workflows/python_sdk_tests.yml
@@ -9,6 +9,10 @@ on:
paths:
- packages/python-sdk/**/*
- .github/workflows/python_sdk_tests.yml
+ workflow_call:
+ secrets:
+ E2B_API_KEY:
+ - required: true
permissions:
contents: read
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 23276c0f5..b5451811c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -37,9 +37,75 @@ jobs:
IS_RELEASE=$(./.github/scripts/is_release.sh)
echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
- release:
+ changes:
+ name: Repository changes
needs: [ is_release ]
if: needs.is_release.outputs.release == 'true'
+ runs-on: ubuntu-latest
+ outputs:
+ js-sdk: ${{ steps.filter.outputs.js-sdk }}
+ python-sdk: ${{ steps.filter.outputs.python-sdk }}
+ cli: ${{ steps.filter.outputs.cli }}
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Get the last release
+ id: last_release
+ uses: cardinalby/git-get-release-action@v1
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ with:
+ latest: true
+ prerelease: false
+ draft: false
+
+ - name: Find changes since the last release
+ uses: dorny/paths-filter@v2
+ id: filter
+ with:
+ base: ${{ steps.last_release.outputs.tag_name }}
+ filters: |
+ js-sdk:
+ - 'packages/js-sdk/**'
+ - '.github/workflows/js_sdk_tests.yml'
+ python-sdk:
+ - 'packages/python-sdk/**'
+ - '.github/workflows/python_sdk_tests.yml'
+ cli:
+ - 'packages/cli/**'
+ - '.github/workflows/cli_tests.yml'
+
+ - name: Read Version file
+ id: getversion
+ run: echo "::set-output name=version::$(cat VERSION)"
+
+ python-tests:
+ name: Python SDK Tests
+ needs: [ changes ]
+ if: needs.changes.outputs.python-sdk == 'true'
+ uses: ./.github/workflows/python-sdk-tests.yml
+ secrets: inherit
+
+ js-tests:
+ name: JS SDK Tests
+ needs: [ changes ]
+ if: needs.changes.outputs.js-sdk == 'true'
+ uses: ./.github/workflows/js-sdk-tests.yml
+ secrets: inherit
+
+ cli-tests:
+ name: CLI Tests
+ needs: [ changes ]
+ if: needs.changes.outputs.cli == 'true'
+ uses: ./.github/workflows/cli-tests.yml
+ secrets: inherit
+
+ release:
+ needs: [ python-tests, js-tests, cli-tests ]
+ if: needs.is_release.outputs.release == 'true'
name: Release
runs-on: ubuntu-latest
steps:
diff --git a/package.json b/package.json
index 5090876c7..e7de05165 100644
--- a/package.json
+++ b/package.json
@@ -7,15 +7,10 @@
"publish": "changeset publish && pnpm run -r postPublish",
"test": "pnpm test --recursive --if-present",
"dev:docs": "pnpm --prefix apps/docs run dev",
-
"rm-node-modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"pnpm-install-hack": "cd packages/js-sdk && sed -i '' 's/\"version\": \".*\"/\"version\": \"9.9.9\"/g' package.json && cd ../.. && pnpm i && git checkout -- packages/js-sdk/package.json"
},
"packageManager": "[email protected]",
- "workspaces": [
- "apps/*",
- "packages/*"
- ],
"dependencies": {
"@changesets/cli": "^2.26.2",
"@changesets/read": "^0.5.9"