From 773126259303c2f020f0b11819537840669347ef Mon Sep 17 00:00:00 2001 From: zjowowen Date: Thu, 31 Oct 2024 17:50:56 +0800 Subject: [PATCH] Add release workflow. --- .github/workflows/release.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e471193..32ecd41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,6 +44,16 @@ jobs: run: | python -m twine upload dist/* + # Step 5: Upload the package to PyPI + - name: Upload to PyPI + if: matrix.python-version == '3.9' # Publish only once, on Python 3.9 + env: + TWINE_USERNAME: "zjowowen" # PyPI username for token-based authentication + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} # Use the token stored in GitHub Secrets + PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring # Disable keyring + run: | + python -m twine upload dist/* + # Step 6: Clean up the build artifacts - name: Remove build artifacts if: matrix.python-version == '3.9' # Clean up once after publishing