forked from e2b-dev/E2B
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (111 loc) · 3.79 KB
/
publish_packages.yml
File metadata and controls
131 lines (111 loc) · 3.79 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
name: Publish Packages
on:
workflow_call:
secrets:
E2B_API_KEY:
required: true
PYPI_TOKEN:
required: true
permissions:
contents: write
id-token: write
jobs:
test:
name: Build and test SDK
runs-on: ubuntu-22.04
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.VERSION_BUMPER_APPID }}
private-key: ${{ secrets.VERSION_BUMPER_SECRET }}
- name: Checkout Repo
uses: actions/checkout@v3
with:
token: ${{ steps.app-token.outputs.token }}
- name: Parse .tool-versions
uses: wistia/parse-tool-versions@v2.1.1
with:
filename: '.tool-versions'
uppercase: 'true'
prefix: 'tool_version_'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: '${{ env.TOOL_VERSION_POETRY }}'
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- uses: pnpm/action-setup@v4
with:
version: '${{ env.TOOL_VERSION_PNPM }}'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '${{ env.TOOL_VERSION_NODEJS }}'
registry-url: 'https://registry.npmjs.org'
cache: pnpm
- name: Configure pnpm
run: |
pnpm config set auto-install-peers true
pnpm config set exclude-links-from-lockfile true
- name: Update npm
run: |
npm install -g npm@^11.6
npm --version
- 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: "" # See https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Generate SDK reference
id: sdk-ref
run: pnpm run --recursive generate-ref
- name: Clone Remote Code Interpreter SDK reference
run: |
git clone --depth 1 --filter=blob:none --sparse https://github.com/e2b-dev/code-interpreter
cd code-interpreter
git sparse-checkout set sdk-reference
cp -r sdk-reference/* ../apps/web/src/app/\(docs\)/docs/sdk-reference/
cd ..
rm -rf code-interpreter
- name: Clone Remote Desktop SDK reference
run: |
git clone --depth 1 --filter=blob:none --sparse https://github.com/e2b-dev/desktop
cd desktop
git sparse-checkout set sdk-reference
cp -r sdk-reference/* ../apps/web/src/app/\(docs\)/docs/sdk-reference/
cd ..
rm -rf desktop
- name: Show docs file structure
run: |
if [ -d "./sdk-reference" ]; then
tree ./sdk-reference
else
echo "sdk-reference directory does not exist"
fi
- 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/sdk-reference
git commit -am "[skip ci] Release new versions" || exit 0
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}