5656    outputs :
5757      js : ${{ steps.filter.outputs.js }} 
5858      python : ${{ steps.filter.outputs.python }} 
59+       charts : ${{ steps.filter.outputs.charts }} 
60+       template : ${{ steps.filter.outputs.template }} 
5961    steps :
6062      - name : Checkout repository 
6163        uses : actions/checkout@v3 
@@ -79,27 +81,147 @@ jobs:
7981          base : ${{ steps.last_release.outputs.tag_name }} 
8082          filters : | 
8183            js: 
82-               - 'js/**' 
84+               - 'js/src/ **' 
8385            python: 
84-               - 'python/**' 
86+               - 'python/e2b_code_interpreter/**' 
87+             charts: 
88+               - 'chart_data_extractor/e2b_charts/**' 
89+             template: 
90+               - 'template/**' 
91+ 
92+ charts-tests :
93+     name : Charts tests 
94+     needs : [changes] 
95+     if : needs.changes.outputs.charts == 'true' 
96+     uses : ./.github/workflows/charts_tests.yml 
97+ 
98+   charts-release :
99+     name : Charts release 
100+     needs : [charts-tests] 
101+     if : needs.changes.outputs.charts == 'true' 
102+     runs-on : ubuntu-latest 
103+     steps :
104+       - name : Checkout Repo 
105+         uses : actions/checkout@v3 
106+ 
107+       - name : Install pnpm 
108+         uses : pnpm/action-setup@v3 
109+         id : pnpm-install 
110+         with :
111+           version : 9.5 
112+ 
113+       - name : Set up Python 
114+         uses : actions/setup-python@v4 
115+         with :
116+           python-version : ' 3.10' 
117+ 
118+       - name : Install and configure Poetry 
119+         uses : snok/install-poetry@v1 
120+         with :
121+           version : 1.5.1 
122+           virtualenvs-create : true 
123+           virtualenvs-in-project : true 
124+           installer-parallel : true 
125+ 
126+       - name : Configure pnpm 
127+         run : | 
128+           pnpm config set auto-install-peers true  
129+           pnpm config set exclude-links-from-lockfile true  
130+ 
131+ name : Install dependencies 
132+         run : pnpm install --frozen-lockfile 
133+ 
134+       - name : Create new versions 
135+         run : pnpm run version 
136+         env :
137+           GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 
138+ 
139+       - name : Release new versions 
140+         run : | 
141+           poetry build 
142+           poetry config pypi-token.pypi ${PYPI_TOKEN} 
143+           poetry publish --skip-existing 
144+ working-directory :  ./chart_data_extractor 
145+         env :
146+           GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 
147+           PYPI_TOKEN : ${{ secrets.CHARTS_PYPI_TOKEN }} 
148+ 
149+ 
150+   build-docker-image :
151+     name : Build Docker Image 
152+     runs-on : ubuntu-latest 
153+     needs : [changes, charts-release] 
154+     if : needs.changes.outputs.template == 'true' || needs.changes.outputs.charts == 'true' 
155+     steps :
156+       - name : Checkout repository 
157+         uses : actions/checkout@v3 
158+         with :
159+           fetch-depth : 0 
160+ 
161+       - name : Set up Docker Buildx 
162+         uses : docker/setup-buildx-action@v3 
163+ 
164+       - name : Log in to DockerHub 
165+         uses : docker/login-action@v3 
166+         with :
167+           username : ${{ secrets.DOCKERHUB_USERNAME }} 
168+           password : ${{ secrets.DOCKERHUB_TOKEN }} 
169+ 
170+       - name : Build and push to DockerHub 
171+         working-directory : ./template 
172+         run : | 
173+           docker pull ${{ secrets.DOCKERHUB_USERNAME }}/code-interpreter:latest || true  
174+           docker buildx build \ 
175+             --file Dockerfile \ 
176+             --platform linux/amd64 \ 
177+             --push \ 
178+             --tag ${{ secrets.DOCKERHUB_USERNAME }}/code-interpreter:latest . 
179+ 
180+ build-template :
181+     name : Build E2B template 
182+     runs-on : ubuntu-latest 
183+     needs : [build-docker-image] 
184+     if : needs.changes.outputs.template == 'true' || needs.changes.outputs.charts == 'true' 
185+     steps :
186+       - name : Checkout repository 
187+         uses : actions/checkout@v3 
188+         with :
189+           fetch-depth : 0 
190+       - name : Install E2B CLI 
191+         run : npm install -g @e2b/cli 
192+ 
193+       - name : Build e2b 
194+         run : e2b template build 
195+         working-directory : ./template 
196+         env :
197+           E2B_ACCESS_TOKEN : ${{ secrets.E2B_ACCESS_TOKEN }} 
85198
86199  python-tests :
87200    name : Python Tests 
88-     needs : [changes] 
89-     if : needs.changes.outputs.python == 'true' 
201+     needs : [changes, build-template] 
202+     if : always() &&  
203+       !contains(needs.*.result, 'failure') && 
204+       !contains(needs.*.result, 'cancelled') && 
205+       (needs.changes.outputs.python == 'true' || needs.changes.outputs.template == 'true') 
90206    uses : ./.github/workflows/python_tests.yml 
91207    secrets : inherit 
92208
93209  js-tests :
94210    name : JS Tests 
95-     needs : [changes] 
96-     if : needs.changes.outputs.js == 'true' 
211+     needs : [changes, build-template] 
212+     if : always() &&  
213+       !contains(needs.*.result, 'failure') && 
214+       !contains(needs.*.result, 'cancelled') && 
215+       (needs.changes.outputs.js == 'true' || needs.changes.outputs.template == 'true') 
97216    uses : ./.github/workflows/js_tests.yml 
98217    secrets : inherit 
99218
100219  release :
101220    needs : [python-tests, js-tests] 
102-     if : (!cancelled()) && !contains(needs.*.result, 'failure') && needs.is_release.outputs.release == 'true' 
221+     if : always() &&  
222+       !contains(needs.*.result, 'failure') && 
223+       !contains(needs.*.result, 'cancelled') && 
224+       (needs.changes.outputs.js == 'true' || needs.changes.outputs.python == 'true') 
103225    name : Release 
104226    runs-on : ubuntu-latest 
105227    steps :
0 commit comments