Skip to content

Commit

Permalink
build ci: do not create full size archive to reduce disk usage
Browse files Browse the repository at this point in the history
  • Loading branch information
aoirint authored Oct 4, 2023
1 parent 10ac2f5 commit 3e68344
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,15 @@ jobs:
# VVPP archives
- name: Create VVPP archives
run: |
# Compress to artifact.001.vvppp,artifact.002.vvppp, ...
(cd "${{ matrix.target }}" && 7z -r a "../compressed.zip")
$split -b 1900M --numeric-suffixes=1 -a 3 --additional-suffix .vvppp ./compressed.zip ./${{ steps.vars.outputs.package_name }}.
# Compress to compressed.zip.001, compressed.zip.002, ...
# NOTE: 1000th archive will be "compressed.zip.1000" after "compressed.zip.999". This is unconsidered as an extreme case.
(cd "${{ matrix.target }}" && 7z -r -v1900M a "../compressed.zip")
# Rename to artifact.001.vvppp, artifact.002.vvppp
for FILE in $(ls "compressed.zip.*"); do
NUMBER=${FILE##*.} # 001
mv "${FILE}" "${{ steps.vars.outputs.package_name }}.${NUMBER}.vvppp"
done
# Rename to artifact.vvpp if there are only artifact.001.vvppp
if [ "$(ls ${{ steps.vars.outputs.package_name }}.*.vvppp | wc -l)" == 1 ]; then
Expand Down

0 comments on commit 3e68344

Please sign in to comment.