Skip to content

Commit 522757b

Browse files
Ro6afFalehander92
authored andcommitted
build(python): publish to PyPI
1 parent 3bd10df commit 522757b

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

.github/workflows/ct-python.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Build Python packages
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
4+
workflow_run:
5+
workflows: ["Codetracer CI"]
6+
types:
7+
- completed
88

99
jobs:
1010
build:
@@ -225,3 +225,32 @@ jobs:
225225
pushd build-python
226226
python -m build --wheel -C--build-option=--plat-name=${{ matrix.plat_name }}
227227
popd
228+
229+
- name: Upload distributions
230+
uses: actions/upload-artifact@v4
231+
with:
232+
name: python-dist-${{ matrix.name }}
233+
path: build-python/dist/*.whl
234+
if-no-files-found: error
235+
236+
publish:
237+
needs: build
238+
# if: startsWith(github.ref, 'refs/tags/')
239+
runs-on: ubuntu-latest
240+
steps:
241+
- name: Download built distributions
242+
uses: actions/download-artifact@v4
243+
with:
244+
path: dist
245+
merge-multiple: true
246+
247+
- name: Publish to TestPyPI
248+
uses: pypa/gh-action-pypi-publish@release/v1
249+
with:
250+
packages_dir: dist
251+
repository-url: https://test.pypi.org/legacy/
252+
253+
# - name: Publish to PyPI
254+
# uses: pypa/gh-action-pypi-publish@release/v1
255+
# with:
256+
# packages_dir: dist

0 commit comments

Comments
 (0)