Skip to content

Commit 521d79f

Browse files
committed
chore: add wheel test, ls
1 parent 955f7d3 commit 521d79f

1 file changed

Lines changed: 39 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
name: Build
1+
name: build
22

33
on:
44
pull_request:
5+
push:
6+
tags:
7+
- 'v*'
58

69
jobs:
710
build_wheels:
@@ -22,7 +25,41 @@ jobs:
2225
- name: Build wheels
2326
run: python -m cibuildwheel --output-dir wheelhouse
2427

28+
- name: Test wheel in virtual environment
29+
run: |
30+
python -m venv .venv
31+
source .venv/bin/activate || .venv/Scripts/activate
32+
pip install wheelhouse/*.whl
33+
python -c "import synapse"
34+
deactivate
35+
2536
- uses: actions/upload-artifact@v4
2637
with:
2738
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
28-
path: ./wheelhouse/*.whl
39+
path: ./wheelhouse/*.whl
40+
41+
publish:
42+
name: Upload wheels to PyPI
43+
needs: [build_wheels]
44+
runs-on: ubuntu-latest
45+
environment:
46+
name: testpypi
47+
url: https://testpypi.org/p/science-synapse
48+
permissions:
49+
id-token: write
50+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
51+
52+
steps:
53+
- uses: actions/download-artifact@v4
54+
with:
55+
pattern: cibw-wheels-*
56+
path: dist
57+
merge-multiple: true
58+
59+
- name: List wheels
60+
run: ls -la dist/
61+
62+
- name: Publish package distributions to PyPI
63+
uses: pypa/gh-action-pypi-publish@release/v1
64+
with:
65+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)