|
| 1 | +name: Show Release Outputs |
| 2 | + |
| 3 | +on: |
| 4 | + push: {} |
| 5 | + |
| 6 | +jobs: |
| 7 | + is_release: |
| 8 | + name: Is release? |
| 9 | + runs-on: ubuntu-latest |
| 10 | + outputs: |
| 11 | + release: ${{ steps.version.outputs.release }} |
| 12 | + steps: |
| 13 | + - name: Checkout Repo |
| 14 | + uses: actions/checkout@v3 |
| 15 | + |
| 16 | + - name: Install pnpm |
| 17 | + uses: pnpm/action-setup@v3 |
| 18 | + id: pnpm-install |
| 19 | + with: |
| 20 | + version: 9.5 |
| 21 | + |
| 22 | + - name: Setup Node |
| 23 | + uses: actions/setup-node@v3 |
| 24 | + with: |
| 25 | + node-version: "18.x" |
| 26 | + registry-url: "https://registry.npmjs.org" |
| 27 | + cache: pnpm |
| 28 | + cache-dependency-path: pnpm-lock.yaml |
| 29 | + |
| 30 | + - name: Configure pnpm |
| 31 | + run: | |
| 32 | + pnpm config set auto-install-peers true |
| 33 | + pnpm config set exclude-links-from-lockfile true |
| 34 | +
|
| 35 | + - name: Install dependencies |
| 36 | + run: pnpm install --frozen-lockfile |
| 37 | + |
| 38 | + - name: Check if new version |
| 39 | + id: version |
| 40 | + run: | |
| 41 | + IS_RELEASE=$(./.github/scripts/is_release.sh) |
| 42 | + echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT" |
| 43 | +
|
| 44 | + changes: |
| 45 | + name: Repository changes |
| 46 | + needs: [is_release] |
| 47 | + if: needs.is_release.outputs.release == 'true' |
| 48 | + runs-on: ubuntu-latest |
| 49 | + outputs: |
| 50 | + js: ${{ steps.js.outputs.release }} |
| 51 | + python: ${{ steps.python.outputs.release }} |
| 52 | + charts: ${{ steps.charts.outputs.release }} |
| 53 | + template: ${{ steps.template.outputs.release }} |
| 54 | + steps: |
| 55 | + - name: Checkout repository |
| 56 | + uses: actions/checkout@v3 |
| 57 | + with: |
| 58 | + fetch-depth: 0 |
| 59 | + |
| 60 | + - name: Get the last release |
| 61 | + id: last_release |
| 62 | + uses: cardinalby/git-get-release-action@v1 |
| 63 | + env: |
| 64 | + GITHUB_TOKEN: ${{ github.token }} |
| 65 | + with: |
| 66 | + latest: true |
| 67 | + prerelease: false |
| 68 | + draft: false |
| 69 | + |
| 70 | + - name: Check JavasScript SDK Release |
| 71 | + id: js |
| 72 | + run: | |
| 73 | + IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "@e2b/code-interpreter") |
| 74 | + echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT" |
| 75 | +
|
| 76 | + - name: Check Python SDK Release |
| 77 | + id: python |
| 78 | + run: | |
| 79 | + IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "e2b-code-interpreter") |
| 80 | + echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT" |
| 81 | +
|
| 82 | + - name: Check Python SDK Release |
| 83 | + id: charts |
| 84 | + run: | |
| 85 | + IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "e2b-charts") |
| 86 | + echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT" |
| 87 | +
|
| 88 | + - name: Check Template SDK Release |
| 89 | + id: template |
| 90 | + run: | |
| 91 | + IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "@e2b/code-interpreter-template") |
| 92 | + echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT" |
| 93 | +
|
| 94 | + changes_print: |
| 95 | + name: Print changes |
| 96 | + needs: [changes] |
| 97 | + runs-on: ubuntu-latest |
| 98 | + - name: Print outputs |
| 99 | + run: | |
| 100 | + echo "JS Release: ${{ changes.outputs.js }}" |
| 101 | + echo "Python Release: ${{ changes.outputs.python }}" |
| 102 | + echo "Charts Release: ${{ changes.outputs.charts }}" |
| 103 | + echo "Template Release: ${{ changes.outputs.template }}" |
0 commit comments