From 2be361d4aa5ffe54691a286103d4c1c54c97e2ad Mon Sep 17 00:00:00 2001 From: Ronnie V Date: Sun, 5 Nov 2023 16:48:40 +0800 Subject: [PATCH] ci(pypi-release.yml): add pypi release workflow (#2) --- .github/workflows/pypi-release.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pypi-release.yml diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..cc893b7 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,31 @@ +name: PyPi Release + +on: + push: + branches: [ "release" ] + +permissions: + contents: read + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + + # Specifying a GitHub environment is optional, but strongly encouraged + environment: release + + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + steps: + # publish to test pypi repo + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + # publish to live pypi repo + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1