Skip to content

Commit

Permalink
CI: Fix artifacts (upload-artifact@v4)
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Jun 21, 2024
1 parent a8b4c23 commit 9a7bda8
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ jobs:
- uses: actions/upload-artifact@v4
with:
name: wheels
# @v4 does not merge artifacts with the name (even if the contents)
# are different. So in a matrix, we have to give each artifact a
# unique name. We merge these later in another job.
name: wheel-${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
path: ./wheelhouse/*.whl

build_sdist:
Expand Down Expand Up @@ -238,13 +241,25 @@ jobs:
- name: Upload Source dist
uses: actions/upload-artifact@v4
with:
name: wheels
name: sdist
path: dist

# Merge all the artifacts into a single bundle
# https://github.com/actions/upload-artifact/blob/main/merge/README.md
merge-artifacts:
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: wheels
delete-merged: true

release:
runs-on: ubuntu-latest
name: Upload Release to PyPI
needs: [build_wheels, build_sdist, parse_commit_info]
needs: [parse_commit_info, merge-artifacts]
if: contains(needs.parse_commit_info.outputs.can_release, 'true')
steps:
- name: Checkout scikit-misc
Expand All @@ -261,7 +276,7 @@ jobs:
uv pip install --system twine
- name: Download wheels
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wheels
path: dist
Expand All @@ -281,7 +296,7 @@ jobs:
pre_release:
runs-on: ubuntu-latest
name: Upload Release to TestPyPI
needs: [build_wheels, build_sdist, parse_commit_info]
needs: [parse_commit_info, merge-artifacts]
if: contains(needs.parse_commit_info.outputs.can_pre_release, 'true')
steps:
- name: Checkout scikit-misc
Expand All @@ -294,7 +309,8 @@ jobs:

- name: Install Release Requirements
run: |
pip install -r requirements/release.txt
pip install uv
uv pip install --system twine
- name: Download wheels
uses: actions/download-artifact@v3
Expand Down

0 comments on commit 9a7bda8

Please sign in to comment.