3 # This script takes in the path to a windows-CLANGARM64-bin artifact downloaded
4 # from GitHub Actions, which lacks the PDF documentation and has the wrong file
5 # layout, and packs it up into a releasable zip file. Assumes that an x86_64
6 # zip built from the same commit already exists locally.
12 echo 1>&2 "Usage: $0 windows-CLANGARM64-bin.zip"
19 trap 'rm -rf "$tmpdir"' EXIT
22 unzip -q -d "$tmpdir" "$ZIP_FROM_GITHUB"
23 DESTDIR=$(basename "$(echo "$tmpdir"/*)")
24 rm -rf "$DESTDIR" "$DESTDIR.zip"
25 cp -a "$tmpdir/$DESTDIR" "$DESTDIR"
26 prefix=$(echo "$DESTDIR" | grep -o 'wimlib.*windows')
27 cp -a "${prefix}-x86_64-bin/doc" "$DESTDIR/doc"
28 chmod +x "$DESTDIR"/*.{dll,exe,cmd}
30 7z -mx9 a ../"$DESTDIR.zip" . > /dev/null
32 echo "Success! Output is in $DESTDIR.zip"