Skip to content

Commit 53d1f9a

Browse files
committed
Updated trusted publisher on pypi
1 parent 578b901 commit 53d1f9a

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

.github/workflows/main.yml

+17-16
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ jobs:
2424
fail-fast: false
2525

2626
steps:
27-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
2828

2929
- name: Set up Python 3.11
30-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v5
3131
with:
3232
python-version: '3.11'
3333

3434
- name: Install dependencies
3535
run: |
3636
python -m pip install --upgrade pip
37-
pip install --editable .
37+
python -m pip install --editable .
3838
3939
build_sdist:
4040
name: sdist on ${{ matrix.os }} with py ${{ matrix.python-version }}
@@ -46,12 +46,12 @@ jobs:
4646
python-version: ['3.9', '3.10', '3.11', '3.12']
4747

4848
steps:
49-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v4
5050
with:
5151
fetch-depth: '0'
5252

5353
- name: Set up Python ${{ matrix.python-version }}
54-
uses: actions/setup-python@v2
54+
uses: actions/setup-python@v5
5555
with:
5656
python-version: ${{ matrix.python-version }}
5757

@@ -67,6 +67,7 @@ jobs:
6767
python -m coveralls --service=github
6868
6969
- name: Build sdist
70+
if: matrix.os == 'ubuntu-latest'
7071
run: |
7172
python -m build
7273
@@ -78,27 +79,27 @@ jobs:
7879
upload_to_pypi:
7980
needs: [build_sdist]
8081
runs-on: ubuntu-latest
82+
permissions:
83+
id-token: write
84+
contents: read
8185

8286
steps:
83-
- uses: actions/download-artifact@v4
87+
- name: Retrieve release distributions
88+
uses: actions/download-artifact@v4
8489
with:
8590
name: artifact
86-
path: dist
91+
path: dist/
8792

88-
- name: Publish to Test PyPI
93+
- name: Publish test to Test.PyPI
8994
# only if working on master
9095
if: github.ref == 'refs/heads/master'
9196
uses: pypa/gh-action-pypi-publish@release/v1
9297
with:
93-
user: __token__
94-
password: ${{ secrets.test_pypi_token }}
95-
repository_url: https://test.pypi.org/legacy/
96-
skip_existing: true
98+
repository-url: https://test.pypi.org/legacy/
99+
skip-existing: true
100+
# verbose: true
97101

98-
- name: Publish to PyPI
102+
- name: Publish release to PyPI
99103
# only if tagged
100104
if: startsWith(github.ref, 'refs/tags')
101105
uses: pypa/gh-action-pypi-publish@release/v1
102-
with:
103-
user: __token__
104-
password: ${{ secrets.pypi_token }}

0 commit comments

Comments
 (0)