mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 08:30:16 +00:00
add release assets workflow
This commit is contained in:
17
hack/assemble.sh
Executable file
17
hack/assemble.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
cd "$(dirname "${0}")/.." || exit 1
|
||||
|
||||
. "hack/common.sh"
|
||||
|
||||
mkdir -p "${ASSEMBLE_DIR}"
|
||||
|
||||
build_arch() {
|
||||
ARCHITECTURE="${1}"
|
||||
TARGET_ARCH="${ARCHITECTURE}" ./hack/build.sh
|
||||
cp "target/final/${ARCHITECTURE}/sprout.efi" "${ASSEMBLE_DIR}/sprout-${ARCHITECTURE}.efi"
|
||||
}
|
||||
|
||||
build_arch x86_64
|
||||
build_arch aarch64
|
||||
11
hack/build.sh
Executable file
11
hack/build.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
cd "$(dirname "${0}")/.." || exit 1
|
||||
|
||||
. "hack/common.sh"
|
||||
|
||||
mkdir -p "${FINAL_DIR}"
|
||||
|
||||
cargo build --target "${RUST_TARGET}" --profile "${RUST_PROFILE}" --bin sprout
|
||||
cp "target/${RUST_TARGET}/${RUST_TARGET_SUBDIR}/sprout.efi" "${FINAL_DIR}/sprout.efi"
|
||||
20
hack/ci/upload-release-assets.sh
Executable file
20
hack/ci/upload-release-assets.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
retry() {
|
||||
for i in $(seq 1 10); do
|
||||
if "${@}"; then
|
||||
return 0
|
||||
else
|
||||
sleep "${i}"
|
||||
fi
|
||||
done
|
||||
"${@}"
|
||||
}
|
||||
|
||||
TAG="${1}"
|
||||
shift
|
||||
|
||||
cd target/assemble
|
||||
|
||||
retry gh release upload "${TAG}" --clobber ./*
|
||||
@@ -20,7 +20,7 @@ HOST_ARCH="$(uname -m)"
|
||||
[ "${TARGET_ARCH}" = "amd64" ] && TARGET_ARCH="x86_64"
|
||||
|
||||
if [ "${TARGET_ARCH}" != "x86_64" ] && [ "${TARGET_ARCH}" != "aarch64" ]; then
|
||||
echo "Unsupported Architecture: ${TARGET_ARCH}" >/dev/stderr
|
||||
echo "Unsupported architecture: ${TARGET_ARCH}" >/dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -34,6 +34,7 @@ RUST_TARGET="${TARGET_ARCH}-unknown-uefi"
|
||||
[ -z "${DOCKER_TAG}" ] && DOCKER_TAG="${DEFAULT_DOCKER_TAG}"
|
||||
DOCKER_TARGET="linux/${TARGET_ARCH}"
|
||||
FINAL_DIR="target/final/${TARGET_ARCH}"
|
||||
ASSEMBLE_DIR="target/assemble"
|
||||
|
||||
if [ -z "${QEMU_ACCEL}" ] && [ "${TARGET_ARCH}" = "${HOST_ARCH}" ] &&
|
||||
[ -f "/proc/cpuinfo" ] &&
|
||||
|
||||
Reference in New Issue
Block a user