Skip to content

Commit f59bc7c

Browse files
authored
Merge pull request #26 from normal-computing/pypi
Add PyPI workflow
2 parents 2f395b0 + 2e5a2c8 commit f59bc7c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/publish_pypi.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
pypi-publish:
9+
name: upload release to PyPI
10+
runs-on: ubuntu-latest
11+
environment: release
12+
permissions:
13+
id-token: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.x'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build
24+
- name: Build package
25+
run: python -m build
26+
- name: Check sdist install and imports
27+
run: |
28+
mkdir -p test-sdist
29+
cd test-sdist
30+
python -m venv venv-sdist
31+
venv-sdist/bin/python -m pip install ../dist/thermox-*.tar.gz
32+
venv-sdist/bin/python -c "import thermox"
33+
- name: Check wheel install and imports
34+
run: |
35+
mkdir -p test-wheel
36+
cd test-wheel
37+
python -m venv venv-wheel
38+
venv-wheel/bin/python -m pip install ../dist/thermox-*.whl
39+
venv-wheel/bin/python -c "import thermox"
40+
- name: Publish package distributions to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)