From 23ccb5326ba491e10a95162b61b4cd6c3ceb9e9a Mon Sep 17 00:00:00 2001 From: Adrian Price-Whelan Date: Sun, 31 Dec 2023 11:44:10 -0500 Subject: [PATCH] resolve merge conflict and add testpypi try --- .github/workflows/cd.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6ea4db9..190369c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,6 +29,30 @@ jobs: - uses: hynek/build-and-inspect-python-package@v2 + # Upload to Test PyPI on every commit on main. + test-publish: + needs: [dist] + name: Test Publish to TestPyPI + environment: pypi + permissions: + id-token: write + runs-on: ubuntu-latest + if: + github.repository_owner == 'adrn' && github.event_name == 'push' && + github.ref == 'refs/heads/main' + + steps: + - name: Download packages built by build-and-inspect-python-package + uses: actions/download-artifact@v4 + with: + name: Packages + path: dist + + - name: Upload package to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + publish: needs: [dist] name: Publish to PyPI @@ -39,14 +63,11 @@ jobs: if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/download-artifact@v4 + - name: Download packages built by build-and-inspect-python-package + uses: actions/download-artifact@v4 with: name: Packages path: dist - uses: pypa/gh-action-pypi-publish@release/v1 if: github.event_name == 'release' && github.event.action == 'published' - with: - # Remember to tell (test-)pypi about this repo before publishing - # Remove this line to publish to PyPI - repository-url: https://test.pypi.org/legacy/