-
Notifications
You must be signed in to change notification settings - Fork 472
119 lines (101 loc) · 4.29 KB
/
release_candidates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Release Candidates
on:
pull_request:
permissions:
contents: write
jobs:
release:
name: Release Candidate
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: pnpm/action-setup@v3
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}
with:
version: 9.5
- name: Setup Node.js 18
uses: actions/setup-node@v4
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') || contains( github.event.pull_request.labels.*.name, 'python-rc') }}
with:
node-version: '18.x'
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Configure pnpm
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Set up Python
uses: actions/setup-python@v4
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}
with:
python-version: "3.9"
- name: Install and configure Poetry
uses: snok/install-poetry@v1
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# - name: Test Python SDK
# if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}
# working-directory: packages/python-sdk
# run: |
# poetry install
# poetry run pytest --verbose -x
# env:
# E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
- name: Release Candidate
if: ${{ contains( github.event.pull_request.labels.*.name, 'python-rc') }}
working-directory: packages/python-sdk
run: |
poetry version prerelease
poetry build
poetry config pypi-token.pypi ${PYPI_TOKEN} && poetry publish --skip-existing
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Install JS dependencies
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}
run: |
pnpm install --frozen-lockfile
# - name: Test JS SDK
# working-directory: packages/js-sdk
# if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') }}
# run: |
# npx playwright install --with-deps
# pnpm run test
# env:
# E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
- name: Release JS Candidate
working-directory: packages/js-sdk
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') }}
run: |
npm version prerelease --preid=${{ github.head_ref }}
npm publish --tag rc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') }}
run: |
pnpm install --frozen-lockfile
- name: Release CLI Candidate
working-directory: packages/cli
if: ${{ contains( github.event.pull_request.labels.*.name, 'cli-rc') }}
run: |
npm version prerelease --preid=${{ github.head_ref }}
npm publish --tag rc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Commit new versions
if: ${{ contains( github.event.pull_request.labels.*.name, 'js-rc') || contains( github.event.pull_request.labels.*.name, 'cli-rc') || contains( github.event.pull_request.labels.*.name, 'python-rc') }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "[skip ci] Release new versions" || exit 0
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}