Skip to content

Commit 415d5bd

Browse files
Williangalvanipatrickelectric
authored andcommitted
CI: split zip files into 2gb~ish chunks
1 parent ce99576 commit 415d5bd

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/test-and-deploy.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -317,36 +317,37 @@ jobs:
317317
- name: Sanitize platform name
318318
run: echo "SANITIZED_PLATFORM=$(echo ${{ matrix.platform }} | tr '/' '-')" >> $GITHUB_ENV
319319

320+
- name: Set asset name
321+
run: |
322+
if [[ ${{ matrix.runner }} == 'pi5-builder' ]]; then
323+
echo "ASSET_NAME_SUFFIX=-pi5" >> $GITHUB_ENV
324+
elif [[ ${{ matrix.os }} == 'bullseye' ]]; then
325+
echo "ASSET_NAME_SUFFIX=-pi4" >> $GITHUB_ENV
326+
fi
327+
320328
- name: Zip image
321-
if: startsWith(github.ref, 'refs/tags/')
322329
run: |
323330
sudo apt install zip
324-
zip BlueOS-raspberry-${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}.zip deploy/pimod/blueos.img
331+
zip -9 -s 2000m BlueOS-raspberry-${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}${{ env.ASSET_NAME_SUFFIX }}.zip deploy/pimod/blueos.img
332+
ls -lah BlueOS-raspberry-${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}${{ env.ASSET_NAME_SUFFIX }}*
325333
326334
- name: Upload artifact
327335
uses: actions/upload-artifact@v4
328336
timeout-minutes: 120
329337
with:
330-
name: BlueOS-raspberry-${{ env.GITHUB_REF_NAME }}${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}
331-
path: deploy/pimod/blueos.img
338+
name: BlueOS-raspberry-${{ env.GITHUB_REF_NAME }}${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}${{ env.ASSET_NAME_SUFFIX }}
339+
path: BlueOS-raspberry-${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}${{ env.ASSET_NAME_SUFFIX }}.z*
332340
if-no-files-found: error
333341
retention-days: 7
334342

335-
- name: Set asset name
336-
run: |
337-
if [[ ${{ matrix.runner }} == 'pi5-builder' ]]; then
338-
echo "ASSET_NAME_SUFFIX=-pi5" >> $GITHUB_ENV
339-
elif [[ ${{ matrix.os }} == 'bullseye' ]]; then
340-
echo "ASSET_NAME_SUFFIX=-pi4" >> $GITHUB_ENV
341-
fi
342-
343343
- name: Upload raspberry image for release
344344
uses: svenstaro/upload-release-action@v2
345345
if: startsWith(github.ref, 'refs/tags/')
346346
with:
347347
repo_token: ${{ secrets.GITHUB_TOKEN }}
348-
file: BlueOS-raspberry-${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}.zip
349-
asset_name: BlueOS-raspberry-${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}${{ env.ASSET_NAME_SUFFIX }}.zip
348+
# Matches single .zip or multi-volume .z01, .z02, ..., .zip
349+
file: BlueOS-raspberry-${{ env.SANITIZED_PLATFORM }}-${{ matrix.os }}${{ env.ASSET_NAME_SUFFIX }}.z*
350+
file_glob: true
350351
tag: ${{ github.ref }}
351352
overwrite: true
352353
prerelease: true

0 commit comments

Comments
 (0)