Skip to content

Commit

Permalink
docs: update examples for v4 of upload-artifact and `download-artif…
Browse files Browse the repository at this point in the history
…act` 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
  • Loading branch information
alugowski committed Dec 20, 2023
1 parent 6e2f4c0 commit 2c49742
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
8 changes: 5 additions & 3 deletions docs/deliver-to-pypi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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
```
Expand Down
6 changes: 4 additions & 2 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```

Expand Down
3 changes: 2 additions & 1 deletion examples/github-apple-silicon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 8 additions & 6 deletions examples/github-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion examples/github-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion examples/github-with-qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2c49742

Please sign in to comment.