Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update actions/upload-artifact to v4 with merge #4042

Merged
merged 5 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions .github/workflows/build_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ jobs:
zip relay-Linux-x86_64-debug.zip relay.debug
mv relay relay-Linux-x86_64

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-linux
path: target/release/relay-Linux-x86_64*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'
Dav1dde marked this conversation as resolved.
Show resolved Hide resolved

macos:
name: macOS
Expand All @@ -62,10 +65,13 @@ jobs:
mv relay relay-Darwin-x86_64
zip -r relay-Darwin-x86_64-dsym.zip relay.dSYM

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-macos
path: target/release/relay-Darwin-x86_64*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

windows:
name: Windows
Expand All @@ -89,7 +95,26 @@ jobs:
7z a relay-Windows-x86_64-pdb.zip relay.pdb
mv relay.exe relay-Windows-x86_64.exe

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-windows
path: target/release/relay-Windows-x86_64*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

merge:
name: Create Release Artifact
runs-on: ubuntu-latest
needs: [linux, macos, windows]
steps:
# Note: due to the immutability of artifacts in upload-artifact v4,
# there cannot be mutliple upload-artifacts with the same name, in a sha's workflow runs.
# However in this case it is fine because this only runs on release/** branches,
# and the other runs on release-library/** branches.
- uses: actions/upload-artifact/merge@v4
with:
# Craft expects release assets to be a single artifact named after the sha.
name: ${{ github.sha }}
pattern: artifact-*
delete-merged: true
37 changes: 31 additions & 6 deletions .github/workflows/build_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ jobs:
env:
TARGET: ${{ matrix.build-arch }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-linux
path: py/dist/*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

macos:
strategy:
Expand Down Expand Up @@ -80,10 +83,13 @@ jobs:
# consumed by cargo and setup.py to obtain the target dir
CARGO_BUILD_TARGET: ${{ matrix.target }}

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-macos
path: py/dist/*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

sdist:
name: Python sdist
Expand All @@ -102,7 +108,26 @@ jobs:
run: python setup.py sdist --format=zip
working-directory: py

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-sdist
path: py/dist/*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

merge:
name: Create Release Artifact
runs-on: ubuntu-latest
needs: [linux, macos, sdist]
steps:
# Note: due to the immutability of artifacts in upload-artifact v4,
# there cannot be mutliple upload-artifacts with the same name, in a sha's workflow runs.
# However in this case it is fine because this only runs on release-library/** branches,
# and the other runs on release/** branches.
- uses: actions/upload-artifact/merge@v4
with:
# Craft expects release assets to be a single artifact named after the sha.
name: ${{ github.sha }}
pattern: artifact-*
delete-merged: true
Loading