From 616749e31f3c74f15a1187bc239f5ae2d4bebb8b Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 17 Sep 2024 13:17:20 -0700 Subject: [PATCH 1/5] upload-artifact v4 with merge --- .github/workflows/build_binary.yml | 33 +++++++++++++++++++++++------ .github/workflows/build_library.yml | 33 +++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index fcc2227a2b..dcb7008ff2 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/build_library.yml b/.github/workflows/build_library.yml index e8421e9338..181bbeded5 100644 --- a/.github/workflows/build_library.yml +++ b/.github/workflows/build_library.yml @@ -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: @@ -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 @@ -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 From 8a9085dc5ac5ae6662d60033d79d1d408f9559d3 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 17 Sep 2024 13:17:43 -0700 Subject: [PATCH 2/5] test run --- .github/workflows/build_binary.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index dcb7008ff2..a8f96b7037 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -2,8 +2,6 @@ name: Binary Release Build on: push: - branches: - - release/** env: CARGO_TERM_COLOR: always From 049ab03a9152d2c4a5df5d114acc96cc1fbd42e6 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 17 Sep 2024 13:41:29 -0700 Subject: [PATCH 3/5] add note --- .github/workflows/build_binary.yml | 10 ++++++++-- .github/workflows/build_library.yml | 8 ++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index a8f96b7037..3804e99481 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -2,6 +2,8 @@ name: Binary Release Build on: push: + branches: + - release/** env: CARGO_TERM_COLOR: always @@ -102,11 +104,15 @@ jobs: compression-level: '0' merge: + name: Create Release Artifact runs-on: ubuntu-latest needs: [linux, macos, windows] steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 + # 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 }} diff --git a/.github/workflows/build_library.yml b/.github/workflows/build_library.yml index 181bbeded5..7d5d56f6a4 100644 --- a/.github/workflows/build_library.yml +++ b/.github/workflows/build_library.yml @@ -117,11 +117,15 @@ jobs: compression-level: '0' merge: + name: Create Release Artifact runs-on: ubuntu-latest needs: [linux, macos, sdist] steps: - - name: Merge Artifacts - uses: actions/upload-artifact/merge@v4 + # 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 }} From 310105306cef60d74b04177392e135d40cde77bd Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Wed, 18 Sep 2024 10:11:24 -0700 Subject: [PATCH 4/5] test run with default compression --- .github/workflows/build_binary.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 3804e99481..0abab12815 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -2,8 +2,6 @@ name: Binary Release Build on: push: - branches: - - release/** env: CARGO_TERM_COLOR: always @@ -40,7 +38,6 @@ jobs: 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 @@ -71,7 +68,6 @@ jobs: 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 @@ -101,7 +97,6 @@ jobs: 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 From 5a010174254ee0eccb5384f7b73985b978ec7418 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Wed, 18 Sep 2024 10:41:00 -0700 Subject: [PATCH 5/5] Revert "test run with default compression" This reverts commit 310105306cef60d74b04177392e135d40cde77bd. --- .github/workflows/build_binary.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_binary.yml b/.github/workflows/build_binary.yml index 0abab12815..3804e99481 100644 --- a/.github/workflows/build_binary.yml +++ b/.github/workflows/build_binary.yml @@ -2,6 +2,8 @@ name: Binary Release Build on: push: + branches: + - release/** env: CARGO_TERM_COLOR: always @@ -38,6 +40,7 @@ jobs: 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 @@ -68,6 +71,7 @@ jobs: 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 @@ -97,6 +101,7 @@ jobs: 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