From 2c4974286fe784b47c157b64a6c61a229b9935ee Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 20 Dec 2023 14:32:28 -0800 Subject: [PATCH] docs: update examples for v4 of `upload-artifact` and `download-artifact` actions (#1705) * docs: update examples for v4 of `upload-artifact` and `download-artifact` actions * docs: use more unique artifact name * docs: update github example workflows to artifact actions v4 --- docs/deliver-to-pypi.md | 8 +++++--- docs/setup.md | 6 ++++-- examples/github-apple-silicon.yml | 3 ++- examples/github-deploy.yml | 14 ++++++++------ examples/github-minimal.yml | 3 ++- examples/github-with-qemu.yml | 3 ++- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/docs/deliver-to-pypi.md b/docs/deliver-to-pypi.md index e49d2bb1..292d8960 100644 --- a/docs/deliver-to-pypi.md +++ b/docs/deliver-to-pypi.md @@ -56,8 +56,9 @@ well as several useful actions. Alongside your existing job(s) that runs cibuild - name: Build SDist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-sdist path: dist/*.tar.gz ``` @@ -74,10 +75,11 @@ This requires setting this GitHub workflow in your project's PyPI settings (for runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: artifact + pattern: cibw-* path: dist + merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 ``` diff --git a/docs/setup.md b/docs/setup.md index cddf46a2..42091b29 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -186,8 +186,9 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/ - name: Build wheels run: pipx run cibuildwheel==2.16.2 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl ``` @@ -224,8 +225,9 @@ To build Linux, Mac, and Windows wheels using GitHub Actions, create a `.github/ - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl ``` diff --git a/examples/github-apple-silicon.yml b/examples/github-apple-silicon.yml index dbae89c2..4df2dd1e 100644 --- a/examples/github-apple-silicon.yml +++ b/examples/github-apple-silicon.yml @@ -14,6 +14,7 @@ jobs: env: CIBW_ARCHS_MACOS: x86_64 arm64 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-macos path: ./wheelhouse/*.whl diff --git a/examples/github-deploy.yml b/examples/github-deploy.yml index 1210da9b..fa80e9ec 100644 --- a/examples/github-deploy.yml +++ b/examples/github-deploy.yml @@ -24,8 +24,9 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.2 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl build_sdist: @@ -37,8 +38,9 @@ jobs: - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-sdist path: dist/*.tar.gz upload_pypi: @@ -51,12 +53,12 @@ jobs: # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir - name: artifact + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* path: dist + merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/examples/github-minimal.yml b/examples/github-minimal.yml index 1d43ad7e..e7336e98 100644 --- a/examples/github-minimal.yml +++ b/examples/github-minimal.yml @@ -23,6 +23,7 @@ jobs: # output-dir: wheelhouse # config-file: "{package}/pyproject.toml" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl diff --git a/examples/github-with-qemu.yml b/examples/github-with-qemu.yml index 494109a3..38f1cb00 100644 --- a/examples/github-with-qemu.yml +++ b/examples/github-with-qemu.yml @@ -26,6 +26,7 @@ jobs: # emulated ones CIBW_ARCHS_LINUX: auto aarch64 ppc64le s390x - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl