Skip to content

Commit

Permalink
Merge pull request #805 from googlefonts/trusted-publishers
Browse files Browse the repository at this point in the history
use trusted publishers workflow (attempt 2)
  • Loading branch information
m4rc1e authored Jan 5, 2024
2 parents cbeeb0a + c1a72c4 commit 7b5749b
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ name: Create and Publish Release

jobs:
build:
name: Create and Publish Release
name: Build distribution
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -50,8 +47,34 @@ jobs:
draft: false
prerelease: false

- name: Build package
run: python -m build
- 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/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
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/gftools
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/gh-action-pypi-publish@v1.8.11
with:
# repository-url: https://test.pypi.org/legacy/ # for testing purposes
verify-metadata: false # twine previously didn't verify metadata when uploading

0 comments on commit 7b5749b

Please sign in to comment.