-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
150 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Configure Docker to support multiarch builds, allowing it to use QEMU to build | ||
# images targeting different CPU architectures. | ||
|
||
# Exit script on first failure. | ||
set -e | ||
|
||
# Echo commands before executing them, by default to stderr. | ||
set -x | ||
|
||
# Exit on unset variable. | ||
set -u | ||
|
||
# Enable multiarch builds with QEMU. | ||
docker run \ | ||
--rm \ | ||
--privileged \ | ||
multiarch/qemu-user-static \ | ||
--reset \ | ||
-p yes | ||
|
||
# Create multiarch build context. | ||
docker context create builder | ||
|
||
# Create multiplatform builder. | ||
docker buildx create builder \ | ||
--name builder \ | ||
--driver docker-container \ | ||
--use | ||
|
||
# Ensure builder has booted. | ||
docker buildx inspect --bootstrap |
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,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit script on first failure. | ||
set -e | ||
|
||
# Echo commands before executing them, by default to stderr. | ||
set -x | ||
|
||
VERSION="$1" | ||
if [[ -z "${VERSION}" ]]; then | ||
>&2 echo "Must specify a version number like 1.2.3" | ||
exit 1 | ||
fi | ||
readonly VERSION | ||
|
||
# Exit on unset variable. | ||
set -u | ||
|
||
# Change directory to repository root. | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
readonly SCRIPT_DIR | ||
cd "${SCRIPT_DIR}/.." | ||
|
||
cd bin | ||
|
||
readonly OUTPUT_DIR="${PWD}/../dist" | ||
mkdir -p "${OUTPUT_DIR}" | ||
|
||
for d in ./*_*; do | ||
FOLDER_NAME="$(basename "$d")" | ||
|
||
# Split FOLDER_NAME into an array with underscore as a delimiter. | ||
IFS="_" read -r -a FOLDER_PARTS <<< "${FOLDER_NAME}" | ||
|
||
OS="${FOLDER_PARTS[0]}" | ||
|
||
# Join remaining parts and remove spaces. | ||
FOLDER_PARTS=("${FOLDER_PARTS[@]:1}") | ||
ARCH="${FOLDER_PARTS[*]}" | ||
ARCH="${ARCH//[[:blank:]]}" | ||
|
||
pushd "$d" | ||
tar \ | ||
--create \ | ||
--compress \ | ||
--file="${OUTPUT_DIR}/screenjournal-v${VERSION}-${OS}-${ARCH}.tar.gz" \ | ||
screenjournal | ||
popd | ||
done |