Skip to content

Commit f854431

Browse files
committed
Use PyPI OIDC
1 parent a2aaf0f commit f854431

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ on:
55
jobs:
66
publish:
77
runs-on: ubuntu-latest
8+
environment:
9+
name: pypi
10+
url: https://pypi.org/p/pyvista-xarray
11+
permissions:
12+
id-token: write # this permission is mandatory for trusted publishing
813
steps:
914
- uses: actions/checkout@v4
15+
with:
16+
persist-credentials: false
1017
- name: Set up Python
1118
uses: actions/setup-python@v5
1219
with:
1320
python-version: "3.12"
1421
- name: Install dependencies
1522
run: |
1623
python -m pip install --upgrade pip
17-
pip install build twine
18-
- name: Build and Publish to PyPI
19-
env:
20-
TWINE_USERNAME: __token__
21-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
22-
run: |
23-
python -m build
24-
twine upload --skip-existing dist/*
24+
pip install build
25+
- name: Build package
26+
run: python -m build
27+
- name: Publish package distributions to PyPI
28+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)