8000 fix(ci): switch PyPI/TestPyPI to OIDC Trusted Publishing (drop invalid token fallback) by dominicusin · Pull Request #49 · dominicusin/package-maximizer · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ jobs:
name: testpypi
url: https://test.pypi.org/p/package-maximizer
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v4
with: {name: dist-test, path: dist}
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.14.2
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# Uses GitHub OIDC Trusted Publishing (permissions: id-token: write above).
# The TestPyPI project "package-maximizer" must have a trusted publisher configured.
11 changes: 5 additions & 6 deletions .github/workflows/publish.yml
8E7C
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
types: [published]
workflow_dispatch:

permissions:
contents: read
permissions: {}

jobs:
build:
Expand All @@ -29,18 +28,18 @@ jobs:
path: dist/

pypi-publish:
name: Upload to PyPI
name: Upload to PyPI (Trusted Publishing)
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/package-maximizer
permissions:
contents: read
id-token: write
steps:
- uses: actions/download-artifact@v4
with: {name: dist, path: dist}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.14.2
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# Uses GitHub OIDC Trusted Publishing (permissions: id-token: write above).
# The PyPI project "package-maximizer" must have a trusted publisher configured.
Loading
0