Skip to content

Commit d85228f

Browse files
committed
added pypi publish hook
1 parent 5d66caf commit d85228f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish distributions to PyPI
2+
3+
# if this workflow is modified to be a generic CI workflow then
4+
# add an if statement to the publish step so it only runs on tags.
5+
on:
6+
push:
7+
tags:
8+
- "v*"
9+
10+
jobs:
11+
build-n-publish:
12+
name: Build and publish distributions to PyPI
13+
if: github.repository == 'cwru-sdle/pvimage'
14+
runs-on: ubuntu-latest
15+
steps:
16+
# fetch all commits and tags so versioneer works
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Install build tools
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install --upgrade setuptools wheel build
30+
- name: Build packages
31+
run: python -m build --sdist --wheel
32+
33+
- name: Publish distribution to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1
35+
with:
36+
user: __token__
37+
password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)