Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GHA release workflow to use trusted publishing / OIDC #631

Merged
merged 1 commit into from
May 2, 2024
Merged
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
23 changes: 19 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches: [master, main]

jobs:
packages:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
Expand All @@ -35,9 +35,24 @@ jobs:
python -m twine check dist/*
shell: bash

- name: Upload dist files for publication
uses: actions/upload-artifact@v2
with:
name: dist-files
path: dist

publish:
runs-on: ubuntu-latest
needs: build
# Run this job in an isolated GHA environment containing the OIDC credentials.
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v2
with:
name: dist-files
path: dist
- name: Publish a Python distribution to PyPI
if: ${{ github.event_name == 'release' }}
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
Loading