From 923e9bde18a935a3e86c231fb73e511025adce7b Mon Sep 17 00:00:00 2001 From: Niklas Melton Date: Tue, 9 Jun 2026 10:13:35 -0500 Subject: [PATCH] test pypi --- .github/workflows/pypi_publish.yml | 17 +++++------ .github/workflows/test_pypi_publish.yml | 40 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test_pypi_publish.yml diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml index d18230a..0743e20 100644 --- a/.github/workflows/pypi_publish.yml +++ b/.github/workflows/pypi_publish.yml @@ -6,12 +6,12 @@ on: permissions: contents: read - id-token: write # required for PyPI Trusted Publishing (OIDC) + id-token: write jobs: build-and-publish: runs-on: ubuntu-latest - environment: pypi # optional but recommended if you configured trusted publisher w/ env + environment: pypi steps: - name: Check out source @@ -25,16 +25,13 @@ jobs: - name: Install build tools run: | python -m pip install --upgrade pip - python -m pip install build + python -m pip install build twine - - name: Build sdist and wheel - run: python -m build + - name: Build distributions + run: python -m build --outdir dist - # Optional sanity check: verify metadata, long_description, etc. - - name: Check dist - run: | - python -m pip install twine - twine check dist/* + - name: Check distributions + run: twine check dist/* - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/test_pypi_publish.yml b/.github/workflows/test_pypi_publish.yml new file mode 100644 index 0000000..db31afe --- /dev/null +++ b/.github/workflows/test_pypi_publish.yml @@ -0,0 +1,40 @@ +name: Publish to TestPyPI + +on: + push: + branches: [main] + +permissions: + contents: read + id-token: write + +jobs: + build-and-publish: + runs-on: ubuntu-latest + environment: testpypi + + steps: + - name: Check out source + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + python -m pip install build twine + + - name: Build distributions + run: python -m build --outdir dist + + - name: Check distributions + run: twine check dist/* + + - name: Publish to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ + repository-url: https://test.pypi.org/legacy/