Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
[E2B-286] - Run release GHA only when really releasing (#114)
Jakub Nováke894b4958f50
diff --git a/.github/scripts/is_release.sh b/.github/scripts/is_release.shnew file mode 100755index 000000000..436d0f077--- /dev/null+++ b/.github/scripts/is_release.sh@@ -0,0 +1,9 @@+#!/bin/sh++# This script checks if the current commit contains changesets.++set -eu++CHANGES=$(node -e "require('@changesets/read').default(process.cwd()).then(result => console.log(!!result.length))")++echo "${CHANGES}"diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 94744ebe3..5a6b3f09e 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -11,7 +11,32 @@ permissions:contents: writejobs:+ is_release:+ name: Is release?+ runs-on: ubuntu-latest+ outputs:+ release: ${{ steps.version.outputs.release }}+ steps:+ - name: Checkout Repo+ uses: actions/checkout@v3++ - name: Setup Node.js 16+ uses: actions/setup-node@v3+ with:+ node-version: 16++ - name: Install npm dependencies+ run: npm ci --workspaces=false++ - name: Check if new version+ id: version+ run: |+ IS_RELEASE=$(./.github/scripts/is_release.sh)+ echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT"+release:+ needs: [ is_release ]+ if: needs.is_release.outputs.release == 'true'name: Releaseruns-on: ubuntu-lateststeps:@@ -23,11 +48,6 @@ jobs:with:python-version: "3.11"- - name: Setup Node.js 16- uses: actions/setup-node@v3- with:- node-version: 16-- name: Install and configure Poetryuses: snok/install-poetry@v1with:@@ -36,6 +56,13 @@ jobs:virtualenvs-in-project: trueinstaller-parallel: true++ - name: Setup Node.js 16+ uses: actions/setup-node@v3+ with:+ node-version: 16++- name: Install dependenciesrun: npm cidiff --git a/package-lock.json b/package-lock.jsonindex e6571154f..e02b64c39 100644--- a/package-lock.json+++ b/package-lock.json@@ -9,7 +9,8 @@"packages/*"],"dependencies": {- "@changesets/cli": "^2.26.2"+ "@changesets/cli": "^2.26.2",+ "@changesets/read": "^0.5.9"}},"apps/dashboard": {diff --git a/package.json b/package.jsonindex 7d7a37a09..2f9c7d72a 100644--- a/package.json+++ b/package.json@@ -11,6 +11,7 @@"packages/*"],"dependencies": {- "@changesets/cli": "^2.26.2"+ "@changesets/cli": "^2.26.2",+ "@changesets/read": "^0.5.9"}}