1
0
Fork 0
mirror of https://github.com/ultrajson/ultrajson.git synced 2024-05-08 02:26:18 +02:00

Deploy to PyPI using trusted publishing (#603)

This commit is contained in:
Hugo van Kemenade 2023-08-17 17:50:59 +03:00 committed by GitHub
commit e9e1e6cb64
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,6 +118,9 @@ jobs:
build-sdist-and-upload:
runs-on: ubuntu-latest
needs: ['build-native-wheels', 'build-QEMU-emulated-wheels']
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
@ -154,16 +157,11 @@ jobs:
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
packages-dir: dist-wheels/
- name: Publish sdist to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Publish wheels to TestPyPI
if: |
@ -171,8 +169,6 @@ jobs:
github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/
packages-dir: dist-wheels/
@ -182,6 +178,4 @@ jobs:
github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository-url: https://test.pypi.org/legacy/