From 72b4b6f3893672f3c983fc6b5cc899be5c1e4042 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Sun, 6 Oct 2024 09:05:11 +0200 Subject: [PATCH] Split large archives Github releas artifacts have a file size limit of 2GiB, so we need to split larger archives. --- .github/workflows/Release.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index cf8c12d..a04f361 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -43,6 +43,21 @@ jobs: with: merge-multiple: true path: ./artifacts + # Files attached to GitHub releases have a size limit of 2GiB + - name: Split large files + env: + GH_TOKEN: ${{ github.token }} + working-directory: artifacts + # Note: will not work on macos, but we can run the release job on ubuntu only. + run: | + MAX_ARCHIVE_SIZE=2147483648 + for archive in ./*.tar.gz; do + archive_size=$(stat -c%s "${archive}") + if (( archive_size >= MAX_ARCHIVE_SIZE )); then + split -b 2GB "${archive}" "${archive}." + rm "${archive}" + fi + done - name: Publish release id: publish-release env: