-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #164 from googlefonts/trusted-publishers
publish-release: update to trusted publishers workflow
- Loading branch information
Showing
1 changed file
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -23,7 +22,7 @@ jobs: | |
- name: Install release dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade setuptools wheel twine | ||
pip install --upgrade setuptools wheel build | ||
- name: Get release notes | ||
id: release_notes | ||
|
@@ -48,10 +47,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 setup.py sdist bdist_wheel | ||
twine upload dist/glyphsets* | ||
- 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/glyphsets | ||
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/ # for testing purposes | ||
verify-metadata: false # twine previously didn't verify metadata when uploading |