Skip to content

Commit 866ce9b

Browse files
committed
Add workflow to publish to pypi
1 parent f4b90a9 commit 866ce9b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build sdist and upload to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
11+
build_sdist:
12+
name: Build sdist and upload to PyPI
13+
runs-on: ubuntu-latest
14+
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/p/Piff
18+
permissions:
19+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.13"
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install -U pip
31+
pip install -U -r requirements.txt
32+
33+
- name: Build sdist
34+
run: |
35+
python setup.py sdist
36+
ls -l dist
37+
tar tvfz dist/*.tar.gz
38+
39+
- name: Publish to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
verbose: true

0 commit comments

Comments
 (0)