From a23e944eb72fed099dae8e146949a7292a3c4f01 Mon Sep 17 00:00:00 2001 From: Genevieve Buckley <30920819+GenevieveBuckley@users.noreply.github.com> Date: Fri, 17 May 2024 11:54:09 +1000 Subject: [PATCH] Workflow to test upload to https://test.pypi.org test server --- .github/workflows/pypi_test_upload.yaml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/pypi_test_upload.yaml diff --git a/.github/workflows/pypi_test_upload.yaml b/.github/workflows/pypi_test_upload.yaml new file mode 100644 index 00000000..74c39de9 --- /dev/null +++ b/.github/workflows/pypi_test_upload.yaml @@ -0,0 +1,37 @@ +name: pypi_test_upload + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + deploy: + # This will upload a Python Package using Twine when a release is created + # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + # + # This job will run when you have tagged a commit, starting with "v*" + # or created a release in GitHub which includes a tag starting with "v*" + # and requires that you have put your twine API key in your + # github secrets (see readme for details) + needs: [] + runs-on: ubuntu-latest + if: contains(github.ref, 'tags') + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install build twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + run: | + python -m build + twine upload --repository testpypi dist/*