diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index 38c8f27..40d9722 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -1,19 +1,20 @@ name: "PyPI release" on: + push: + branches: + - sroet-patch-1 release: types: - published # Following: https://docs.pypi.org/trusted-publishers/using-a-publisher/ +# and https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ jobs: - publish_release: + build-release: runs-on: [self-hosted, linux, x64, gpu] container: image: continuumio/miniconda3 options: --runtime=nvidia --gpus all - environment: release - permissions: - id-token: write steps: - name: Pull code uses: actions/checkout@v4 @@ -26,11 +27,38 @@ jobs: - name: twine check distributions run: | python -m twine check dist/* - - name: Publish package distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1.11 # temporary workaround for issue #236 + - name: Store the distribution packages + uses: actions/upload-artifact@v4 with: + name: match-pick-distributions + path: dist/ + + publish-to-testpypi: + name: publish to test-pypi + needs: build-release + runs-on: ubuntu-latest + #environment: release + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: match-pick-distributions + path: dist/ + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: repository-url: https://test.pypi.org/legacy/ - attestations: false + + test-testpypi: + name: test testpypi deployment + needs: publish-to-testpypi + runs-on: [self-hosted, linux, x64, gpu] + container: + image: continuumio/miniconda3 + options: --runtime=nvidia --gpus all + steps: - name: Download conda dependencies run: | conda install -y -c conda-forge python=3 cupy cuda-version=11.8 @@ -40,7 +68,21 @@ jobs: - name: Run tests on the installed package run: | python -m unittest discover tests/ - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@release/v1.11 # temporary workaround for issue #236 - with: - attestations: false + + publish-to-pypi: + name: publish to pypi + needs: [build-release, test-testpypi] + runs-on: ubuntu-latest + #environment: release + permissions: + id-token: write + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: match-pick-distributions + path: dist/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + +