Skip to content

Commit

Permalink
build(deps): upgrade actions/{upload,download}-artifact@v3 to v4 (#829)
Browse files Browse the repository at this point in the history
* update actions/upload-artifact from v3 to v4

* update actions/download-artifact from v3 to v4

* build(dist): each build artifact gets a unique key and merged separately

Uploads are now immutable for actions/upload-artifact@v4.

This gives each build artifact a unique key, and then merges them together at the end.
The [migration guide] suggests this pattern.

[migration guide]: https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md#merging-multiple-artifacts

* use matrix.os to create unique upload key for build-python-mac-win job

* use manylinux-x86_64 name for consistency with manylinux-aarch64
  • Loading branch information
Michael-J-Ward authored Aug 23, 2024
1 parent 02414d8 commit 22c70ef
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
59 changes: 39 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
override: true
- name: Generate license file
run: python ./dev/create_license.py
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: python-wheel-license
path: LICENSE.txt
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:

- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .
Expand All @@ -110,9 +110,9 @@ jobs:
run: find target/wheels/

- name: Archive wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-${{ matrix.os }}
path: target/wheels/*

build-macos-aarch64:
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:

- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .
Expand All @@ -162,20 +162,20 @@ jobs:
run: find target/wheels/

- name: Archive wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-macos-aarch64
path: target/wheels/*

build-manylinux:
build-manylinux-x86_64:
needs: [generate-license]
name: Manylinux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .
Expand All @@ -191,9 +191,9 @@ jobs:
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
args: --release --manylinux 2014 --features protoc,substrait
- name: Archive wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-manylinux-x86_64
path: target/wheels/*

build-manylinux-aarch64:
Expand All @@ -204,7 +204,7 @@ jobs:
- uses: actions/checkout@v4
- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .
Expand All @@ -221,9 +221,9 @@ jobs:
rustup-components: rust-std rustfmt # Keep them in one line due to https://github.com/PyO3/maturin-action/issues/153
args: --release --features protoc,substrait
- name: Archive wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-manylinux-aarch64
path: target/wheels/*

build-sdist:
Expand All @@ -234,7 +234,7 @@ jobs:
- uses: actions/checkout@v4
- run: rm LICENSE.txt
- name: Download LICENSE.txt
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-wheel-license
path: .
Expand All @@ -246,19 +246,38 @@ jobs:
manylinux: auto
rustup-components: rust-std rustfmt
args: --release --sdist --out dist --features protoc,substrait
- name: Archive wheels
uses: actions/upload-artifact@v3
- name: Assert sdist build does not generate wheels
run: |
if [ "$(ls -A target/wheels)" ]; then
echo "Error: Sdist build generated wheels"
exit 1
else
echo "Directory is clean"
fi
shell: bash

merge-build-artifacts:
runs-on: ubuntu-latest
needs:
- build-python-mac-win
- build-macos-aarch64
- build-manylinux-x86_64
- build-manylinux-aarch64
- build-sdist
steps:
- name: Merge Build Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: dist
path: target/wheels/*

pattern: dist-*
# NOTE: PyPI publish needs to be done manually for now after release passed the vote
# release:
# name: Publish in PyPI
# needs: [build-manylinux, build-python-mac-win]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v3
# - uses: actions/download-artifact@v4
# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
run: |
conda mambabuild --test packages/${{ matrix.arch }}/*.tar.bz2
- name: Upload conda packages as artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "conda nightlies (python - ${{ matrix.python }}, arch - ${{ matrix.arch }})"
# need to install all conda channel metadata to properly install locally
Expand Down

0 comments on commit 22c70ef

Please sign in to comment.