Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonhunt02 authored Dec 30, 2024
1 parent c7c6f92 commit ebce63e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/zip-upload-split/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,33 @@ runs:
# Github upload limit is less than stated 2147483648 bytes (2147483k).
MAX_SIZE: 2050000000
MAX_SIZE_K: 2050000
SHA256_7ZIP: 'cb5e49caaf761df67add54729553bef89a38071b0c455461452578018625fee5'
run: |
mkdir _temp
NAME=$( basename ${{ inputs.zip-path }} )
SIZE=$( stat -c %s ${{ inputs.zip-path }} )
mkdir _temp
if [ "${SIZE}" -le "${MAX_SIZE}" ]; then
cp ${{ inputs.zip-path }} _temp/${NAME};
elif [ ${{ inputs.zip-cmd }} == '7zip' ]; then
# On ubuntu-22.04 and ubuntu-24.04 apt package has a bug
# https://sourceforge.net/p/sevenzip/bugs/2407/
# sudo apt install -y 7zip;
# Checksum
curl -O "https://www.7-zip.org/a/7z2409-linux-x86.tar.xz";
if ! echo "${SHA256_7ZIP} 7z2409-linux-x86.tar.xz" | sha256sum -c ; then
echo "Incorrect 7zip package SHA256 checksum. Downloading from mirror..." >&2;
rm 7z2409-linux-x86.tar.xz;
curl -OL "https://github.com/ip7z/7zip/releases/download/24.09/7z2409-linux-x86.tar.xz";
if ! echo "${SHA256_7ZIP} 7z2409-linux-x86.tar.xz" | sha256sum -c ; then
echo "7zip package SHA256 check failed." >&2;
exit 1;
fi
fi
tar -xvf 7z2409-linux-x86.tar.xz "7zz";
chmod +x 7zz;
./7zz a -tzip -v${MAX_SIZE_K}k _temp/${NAME} ${{ inputs.zip-path }};
Expand All @@ -45,6 +61,7 @@ runs:
# unknown zip bug can corrupt files in split archives
zip ${{ inputs.zip-path }} --out _temp/${NAME} -s "${MAX_SIZE_K}k";
fi
tree
cd _temp
for file in *; do \
Expand Down

0 comments on commit ebce63e

Please sign in to comment.