Skip to content

Commit b2eefa3

Browse files
committed
Update publish.yml for PyPI Trusted Publishing (OIDC)
1 parent 89fe51a commit b2eefa3

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: Publish StepDistanceCalculator to PyPI
22

33
on:
4+
push:
5+
tags:
6+
- 'v*'
47
release:
58
types: [published]
69
workflow_dispatch:
710

811
jobs:
9-
build-and-publish:
12+
pypi-publish:
13+
name: Build and publish Python package to PyPI
1014
runs-on: ubuntu-latest
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/p/StepDistanceCalculator
1118
permissions:
1219
id-token: write # Mandatory for PyPI Trusted Publishing (OIDC)
1320
contents: read
@@ -21,21 +28,15 @@ jobs:
2128
with:
2229
python-version: "3.11"
2330

24-
- name: Install Build Dependencies
31+
- name: Install build tool
2532
run: |
2633
python -m pip install --upgrade pip
27-
pip install build twine
34+
pip install build
2835
29-
- name: Build Package
30-
run: |
31-
python -m build
32-
33-
- name: Check Distribution
34-
run: |
35-
python -m twine check dist/*
36+
- name: Build package
37+
run: python -m build
3638

37-
- name: Publish to PyPI
39+
- name: Publish package to PyPI
3840
uses: pypa/gh-action-pypi-publish@release/v1
3941
with:
40-
password: ${{ secrets.PYPI_API_TOKEN }}
4142
skip-existing: true

0 commit comments

Comments
 (0)