Skip to content

Commit

Permalink
Merge pull request #81 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 authored Jan 8, 2024
2 parents bb078d5 + b04a132 commit 56f49d1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,28 @@ on:
types: [published]
workflow_dispatch:


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-inventory
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
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 56f49d1

Please sign in to comment.