Skip to content

Commit

Permalink
Merge pull request #74 from cfpb/pypi-trusted-publishing
Browse files Browse the repository at this point in the history
Use PyPI trusted publishing on release
  • Loading branch information
willbarton committed Jan 8, 2024
2 parents 705f5a5 + ab0ac0d commit 19e1ace
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ on:

jobs:
build:
name: Build and publish release to PyPI
runs-on: ubuntu-latest
# This uses PyPI trusted publishing
environment:
name: pypi
url: https://pypi.org/p/wagtail-sharing
permissions:
id-token: write
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
pip install twine wheel
- name: Build the package
run: |
python -m build
- name: Upload to PyPI
run: twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 19e1ace

Please sign in to comment.