Skip to content

Commit

Permalink
upload-artifact v4 with merge
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuarli committed Sep 17, 2024
1 parent 0198a23 commit 616749e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 12 deletions.
33 changes: 27 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'

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,22 @@ 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:
runs-on: ubuntu-latest
needs: [linux, macos, windows]
steps:
- name: Merge Artifacts
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
33 changes: 27 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,22 @@ 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:
runs-on: ubuntu-latest
needs: [linux, macos, sdist]
steps:
- name: Merge Artifacts
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

0 comments on commit 616749e

Please sign in to comment.