From f4bb4ef8c5952736d671f91ee3c7291c2e9e503b Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Fri, 15 Nov 2024 14:34:28 +0100 Subject: [PATCH 1/8] debug pypi workflow --- .github/workflows/do-release.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index 38c8f27..8b17b75 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -26,8 +26,12 @@ jobs: - name: twine check distributions run: | python -m twine check dist/* + - name: debug code + run: | + ls /home/githubrunner/actions-runner/_work/_actions/ + ls /__w/_actions - name: Publish package distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1.11 # temporary workaround for issue #236 + uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ attestations: false @@ -41,6 +45,6 @@ jobs: 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 + uses: pypa/gh-action-pypi-publish@release/v1 with: attestations: false From 857b8502579081409f1a6cf03d5788014a6ac3f6 Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Fri, 15 Nov 2024 14:36:10 +0100 Subject: [PATCH 2/8] let release run on test branch --- .github/workflows/do-release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index 8b17b75..55a727e 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -1,5 +1,8 @@ name: "PyPI release" on: + push: + branches: + - sroet-patch-1 release: types: - published From 3f477b66bbba62a5a4e92b07a64f195f3760e211 Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Fri, 15 Nov 2024 14:37:39 +0100 Subject: [PATCH 3/8] drop environment (should fail pypi release) --- .github/workflows/do-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index 55a727e..ea4afed 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -14,7 +14,7 @@ jobs: container: image: continuumio/miniconda3 options: --runtime=nvidia --gpus all - environment: release + # environment: release permissions: id-token: write steps: From 784f0a07e31548e7a8db9cfab55f7c0221cc01a8 Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Fri, 15 Nov 2024 14:39:48 +0100 Subject: [PATCH 4/8] start with /home instead of the whole thing --- .github/workflows/do-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index ea4afed..de3315e 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -31,7 +31,7 @@ jobs: python -m twine check dist/* - name: debug code run: | - ls /home/githubrunner/actions-runner/_work/_actions/ + ls /home ls /__w/_actions - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 From 5df5db798f18c4906f1c1aab9c161c774052d496 Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Fri, 15 Nov 2024 14:41:23 +0100 Subject: [PATCH 5/8] split out ls commands --- .github/workflows/do-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index de3315e..82cd4c2 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -32,6 +32,8 @@ jobs: - name: debug code run: | ls /home + - name: debug part 2 + run: | ls /__w/_actions - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 From d31930dd8c3da1f98b8fbc12bb5a67a72d65609c Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Fri, 15 Nov 2024 15:35:07 +0100 Subject: [PATCH 6/8] more lses --- .github/workflows/do-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index 82cd4c2..8bff3db 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -31,10 +31,10 @@ jobs: python -m twine check dist/* - name: debug code run: | - ls /home + ls / - name: debug part 2 run: | - ls /__w/_actions + ls -R /__w/ - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From b4c96cbd37c75e192ac404d4a416a9ca107526e3 Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Tue, 19 Nov 2024 15:00:37 +0100 Subject: [PATCH 7/8] rewrite do-release.yml to split out steps --- .github/workflows/do-release.yml | 67 ++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 17 deletions(-) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index 8bff3db..c4560e7 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -8,15 +8,13 @@ on: - 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 @@ -29,17 +27,38 @@ jobs: - name: twine check distributions run: | python -m twine check dist/* - - name: debug code - run: | - ls / - - name: debug part 2 - run: | - ls -R /__w/ - - name: Publish package distributions to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 + - 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: python-package-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 @@ -49,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 - 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: python-package-distributions + path: dist/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + From 99de9f8217f54d7b57484689532dfd0271a39ba9 Mon Sep 17 00:00:00 2001 From: Sander Roet Date: Tue, 19 Nov 2024 15:02:12 +0100 Subject: [PATCH 8/8] Update artifact pull name --- .github/workflows/do-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml index c4560e7..40d9722 100644 --- a/.github/workflows/do-release.yml +++ b/.github/workflows/do-release.yml @@ -44,7 +44,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - name: python-package-distributions + name: match-pick-distributions path: dist/ - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 @@ -80,7 +80,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v4 with: - name: python-package-distributions + name: match-pick-distributions path: dist/ - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1