From adce1d944d216e952b33982bd36609f3944ada04 Mon Sep 17 00:00:00 2001 From: Jia Yu Date: Mon, 2 Dec 2024 16:33:08 -0800 Subject: [PATCH 1/4] Initial try --- .github/workflows/python-publish-pypi.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish-pypi.yml b/.github/workflows/python-publish-pypi.yml index d5203c5..731931f 100644 --- a/.github/workflows/python-publish-pypi.yml +++ b/.github/workflows/python-publish-pypi.yml @@ -54,6 +54,7 @@ jobs: - uses: actions/upload-artifact@v4 with: + name: cibw-sdist path: python/dist/*.tar.gz upload_pypi: @@ -64,20 +65,21 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - # unpacks wheel files into artifacts/wheels + # unpacks wheel files into artifacts pattern: cibw-* merge-multiple: false - path: artifacts/wheels - - name: Copy wheels to the dist folder + path: artifacts + - name: Copy everything to the dist folder run: | mkdir -p dist - for pattern in artifacts/wheels/cibw-wheels-macos-*/* artifacts/wheels/cibw-wheels-ubuntu-*/* artifacts/wheels/cibw-wheels-windows-*/*; do + for pattern in cibw-sdist artifacts/cibw-wheels-macos-*/* artifacts/cibw-wheels-ubuntu-*/* artifacts/cibw-wheels-windows-*/*; do cp -r $pattern dist 2>/dev/null || echo "No files matched $pattern" done echo "Content copied to dist." - + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} - # repository_url: https://test.pypi.org/legacy/ # to test \ No newline at end of file + repository_url: https://test.pypi.org/legacy/ # to test \ No newline at end of file From 05c0748dfaa191211d79cc2e70baa283c70e4992 Mon Sep 17 00:00:00 2001 From: Jia Yu Date: Mon, 2 Dec 2024 16:34:46 -0800 Subject: [PATCH 2/4] Enable for all cases --- .github/workflows/python-publish-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish-pypi.yml b/.github/workflows/python-publish-pypi.yml index 731931f..b0b941a 100644 --- a/.github/workflows/python-publish-pypi.yml +++ b/.github/workflows/python-publish-pypi.yml @@ -61,7 +61,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # publish when a GitHub Release is created - if: github.event_name == 'release' && github.event.action == 'published' + # if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 with: From 19e05b482f0eef78772e6bf4b032ef00deb44204 Mon Sep 17 00:00:00 2001 From: Jia Yu Date: Mon, 2 Dec 2024 16:47:21 -0800 Subject: [PATCH 3/4] Fix the pattern --- .github/workflows/python-publish-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish-pypi.yml b/.github/workflows/python-publish-pypi.yml index b0b941a..422cfa5 100644 --- a/.github/workflows/python-publish-pypi.yml +++ b/.github/workflows/python-publish-pypi.yml @@ -72,7 +72,7 @@ jobs: - name: Copy everything to the dist folder run: | mkdir -p dist - for pattern in cibw-sdist artifacts/cibw-wheels-macos-*/* artifacts/cibw-wheels-ubuntu-*/* artifacts/cibw-wheels-windows-*/*; do + for pattern in artifacts/cibw-sdist/* artifacts/cibw-wheels-macos-*/* artifacts/cibw-wheels-ubuntu-*/* artifacts/cibw-wheels-windows-*/*; do cp -r $pattern dist 2>/dev/null || echo "No files matched $pattern" done echo "Content copied to dist." From 07726717f9910b8273ec442ecc30d046438f54b7 Mon Sep 17 00:00:00 2001 From: Jia Yu Date: Mon, 2 Dec 2024 17:00:19 -0800 Subject: [PATCH 4/4] Everything is working now --- .github/workflows/python-publish-pypi.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish-pypi.yml b/.github/workflows/python-publish-pypi.yml index 422cfa5..8ac89e1 100644 --- a/.github/workflows/python-publish-pypi.yml +++ b/.github/workflows/python-publish-pypi.yml @@ -61,7 +61,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # publish when a GitHub Release is created - # if: github.event_name == 'release' && github.event.action == 'published' + if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 with: @@ -82,4 +82,4 @@ jobs: with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} - repository_url: https://test.pypi.org/legacy/ # to test \ No newline at end of file + # repository_url: https://test.pypi.org/legacy/ # to test \ No newline at end of file