-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only upload one copy of linux binaries to releases
We upload the statically-linked Alpine edge binaries, as these are probably the most portable. Note that the statically-linked Alpine binaries are actually smaller than the Debian executables (~35 MB archive vs ~41 MB archive), though the Debian ones are pie (position-independent executables, supporting Address Space Layout Randomization).
- Loading branch information
1 parent
4a67334
commit bea8f57
Showing
6 changed files
with
107 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage() { | ||
>&2 printf "%s FILENAME [DEFAULT_ARCH]\n" "$0" | ||
} | ||
|
||
fname="$1" | ||
default="$2" | ||
if [ -z "$fname" ] || [ "$fname" = "-h" ] || [ "$fname" = "--help" ]; then | ||
usage | ||
fi | ||
if [ -z "$fname" ]; then | ||
exit 1 | ||
fi | ||
|
||
if [ ! -z "${SHELL}" ]; then | ||
run() { | ||
"${SHELL}" -c "$*" || true | ||
} | ||
else | ||
run() { | ||
/bin/sh -c "$*" || true | ||
} | ||
fi | ||
|
||
if [ ! -z "$CI" ]; then | ||
group() { | ||
echo "::group::$*" | ||
run "$@" | ||
echo "::endgroup::" | ||
} | ||
else | ||
group() { run "$@"; } | ||
fi | ||
|
||
>&2 group file "$fname" | ||
>&2 group otool -L "$fname" || true | ||
>&2 group lipo -info "$fname" || true | ||
file_info="$(file "$fname" 2>&1)" | ||
case "${file_info}" in | ||
*x86_64*|*x86-64*) | ||
arch=x86_64 | ||
;; | ||
*) | ||
if [ -z "$default" ]; then | ||
arch="$(printf "%s\n" "${file_info}" | awk '{print $NF}')" | ||
else | ||
arch="$default" | ||
fi | ||
>&2 echo "::warning::Unknown architecture ${file_info} (using ${arch})" | ||
;; | ||
esac | ||
|
||
printf "%s\n" "$arch" |