Skip to content

Commit 89fe51a

Browse files
committed
Add GitHub Actions workflow for PyPI publishing
1 parent 6519f92 commit 89fe51a

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish StepDistanceCalculator to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write # Mandatory for PyPI Trusted Publishing (OIDC)
13+
contents: read
14+
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Install Build Dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build twine
28+
29+
- name: Build Package
30+
run: |
31+
python -m build
32+
33+
- name: Check Distribution
34+
run: |
35+
python -m twine check dist/*
36+
37+
- name: Publish to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1
39+
with:
40+
password: ${{ secrets.PYPI_API_TOKEN }}
41+
skip-existing: true

0 commit comments

Comments
 (0)