Skip to content

Commit

Permalink
Update python-publish.yml to use OIDC secretless
Browse files Browse the repository at this point in the history
  • Loading branch information
Dexterp37 authored Oct 1, 2023
1 parent 1c6278e commit d2e2241
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# https://docs.pypi.org/trusted-publishers/using-a-publisher/

name: Upload Python Package

Expand All @@ -16,10 +10,14 @@ permissions:
contents: read

jobs:
deploy:
pypi-publish:

runs-on: ubuntu-latest
environment: release

permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -32,8 +30,7 @@ jobs:
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@8ef2b3d46c9ecba901fb2ae21d98e322c4089c4e
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

0 comments on commit d2e2241

Please sign in to comment.