From a2543b9ad0836b85e54f126124006f0f09df46fd Mon Sep 17 00:00:00 2001 From: Hsiaoming Yang Date: Sun, 10 Dec 2023 16:00:26 +0900 Subject: [PATCH] chore: add pypi github action --- .github/workflows/pypi.yml | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/pypi.yml diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml new file mode 100644 index 00000000..809cf159 --- /dev/null +++ b/.github/workflows/pypi.yml @@ -0,0 +1,54 @@ +name: Release to PyPI + +permissions: + contents: write + +on: + push: + +jobs: + build: + name: build dist files + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: install build + run: python -m pip install --upgrade build + + - name: build dist + run: python -m build + + - uses: actions/upload-artifact@v3 + with: + name: artifacts + path: dist/* + if-no-files-found: error + + publish: + environment: + name: pypi-release + url: https://pypi.org/project/Authlib/ + permissions: + id-token: write + name: release to pypi + needs: build + runs-on: ubuntu-latest + + steps: + - uses: actions/download-artifact@v3 + with: + name: artifacts + path: dist + + - name: Push build artifacts to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true + repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.PYPI_API_TOKEN }}