Skip to content

Commit

Permalink
Merge pull request #122 from googlefonts/trusted-publishers
Browse files Browse the repository at this point in the history
update test-push.yml to use trusted publishers workflow
  • Loading branch information
m4rc1e authored Jan 8, 2024
2 parents ee757b8 + 28dcf76 commit 6483e31
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ name: Create and Publish Release

jobs:
build:
name: Create and Publish Release
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -49,10 +48,34 @@ jobs:
draft: false
prerelease: false

- name: Build and publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/diffenator2
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
verify-metadata: false # twine previously didn't verify metadata when uploading

0 comments on commit 6483e31

Please sign in to comment.