Skip to content

Commit ee5d3e9

Browse files
committed
add publish workflow
1 parent 6b79f75 commit ee5d3e9

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/pypi_publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
pypi-publish:
10+
name: Upload release to PyPI
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/<your-pypi-project-name>
15+
permissions:
16+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python 3.13
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.13'
23+
- name: Python info
24+
run: |
25+
which python
26+
python --version
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip poetry
30+
poetry config virtualenvs.create false
31+
- name: Build package
32+
run: |
33+
poetry build
34+
- name: Test package
35+
run: |
36+
poetry install --only dev
37+
python -m twine check dist/*
38+
- name: Verify metadata (optional but recommended)
39+
run: twine check dist/*
40+
41+
- name: Publish package distributions to PyPI
42+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)