From 7bbd97c8e29365b7b110f28db2013400409798b5 Mon Sep 17 00:00:00 2001 From: Nathan Goldbaum Date: Thu, 8 Feb 2024 10:40:24 -0700 Subject: [PATCH] Add a workflow step to automate uploading to testpypi Signed-off-by: Nathan Goldbaum --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdd164e67..5a485165f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -616,3 +616,33 @@ jobs: - name: Python Test Steps run: make test TEST_ARGS="-k TestDBReader" if: ${{ contains( 'sqlalchemy', matrix.package )}} + + #7# + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + #~~~~~~Upload to testpypi~~~~~~~# + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + testpypi_publish: + needs: + - build_sdist + - build + + runs-on: ubuntu-22.04 + permissions: + id-token: write + steps: + - name: Download wheels and sdist + uses: actions/download-artifact@v4 + path: ~/dist + with: + name: + merge-multiple: true + + - name: Display structure of downloaded files + run: ls -R dist + + - name: Publish version to testpypi + # only actually upload to testpypi on pushes to main + if: github.reg == 'regs/heads/main' && github.event_name != 'pull_request' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy