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
This commit is contained in:
Adam Lugowski
2023-12-20 17:32:28 -05:00
committed by GitHub
parent 6e2f4c00ab
commit 2c4974286f
6 changed files with 23 additions and 14 deletions
+5 -3
View File
@@ -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
```
+4 -2
View File
@@ -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
```
+2 -1
View File
@@ -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
+8 -6
View File
@@ -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:
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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