From b4ef8858befdda412264de5d8078f5a59bfb4f09 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sun, 27 Aug 2023 17:16:28 +0200 Subject: [PATCH] Test publishing on TestPyPI --- .github/workflows/{test.yml => ci.yaml} | 28 +++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) rename .github/workflows/{test.yml => ci.yaml} (66%) diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yaml similarity index 66% rename from .github/workflows/test.yml rename to .github/workflows/ci.yaml index bbca5a99b6..b1fcf4ffde 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yaml @@ -1,11 +1,11 @@ -name: Tests (tox) +name: CI on: - push - pull_request jobs: - build: + tests: runs-on: ubuntu-latest strategy: matrix: @@ -41,3 +41,27 @@ jobs: - uses: codecov/codecov-action@v3 with: directory: '.tox/reports' + + publish: + needs: [tests] + runs-on: ubuntu-latest + environment: testpypi + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Build + run: | + pip install build + python3 -m build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/