Skip to content

Commit 7b76a99

Browse files
committed
Switch to API token authentication for PyPI publishing
1 parent 19ce264 commit 7b76a99

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

.github/workflows/publish-release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
permissions:
1010
contents: read
11-
id-token: write
1211

1312
jobs:
1413
publish-release:
@@ -38,6 +37,8 @@ jobs:
3837
twine check --strict dist/*
3938
4039
- name: 🚀 Publish to PyPI
41-
uses: pypa/gh-action-pypi-publish@release/v1
42-
with:
43-
attestations: true
40+
env:
41+
TWINE_USERNAME: __token__
42+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
43+
run: |
44+
twine upload dist/*
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish rffickle to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- 'setup.py'
9+
- 'src/**'
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
publish-test:
16+
name: Publish Test Package
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
steps:
20+
- name: 📥 Checkout the repository
21+
uses: actions/checkout@v4
22+
23+
- name: 🐍 Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.10'
27+
28+
- name: 📦 Install build dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install build twine
32+
33+
- name: 🏗️ Build source and wheel distributions
34+
run: |
35+
python -m build
36+
twine check --strict dist/*
37+
38+
- name: 🚀 Publish to TestPyPI
39+
env:
40+
TWINE_USERNAME: __token__
41+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
42+
run: |
43+
twine upload --repository testpypi dist/*

0 commit comments

Comments
 (0)