From 06fddc43c350375629bcf8181ca1ccfa54359216 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Thu, 19 Dec 2024 22:31:55 -0500 Subject: [PATCH] Create script for releases --- scripts/{do-release.sh => do-bundle.sh} | 0 scripts/release.sh | 43 ++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) rename scripts/{do-release.sh => do-bundle.sh} (100%) mode change 100755 => 100644 diff --git a/scripts/do-release.sh b/scripts/do-bundle.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/do-release.sh rename to scripts/do-bundle.sh diff --git a/scripts/release.sh b/scripts/release.sh index 9ab6da0..d2c7abc 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,6 +1,47 @@ +version=$(cat Cargo.toml | sed -n -e '/version/ {s/.* = *//p;q}' | tr -d '"') + +read -p "You wanted to release $version, right? [Y/n] " -n 1 -r +echo +case "$REPLY" in + n|N ) exit 1;; +esac + if [ -z "${RELEASE_TOKEN}" ]; then echo "Please set the RELEASE_TOKEN env var." exit 1 fi +if ! command -v curl 2>&1 >/dev/null; then + echo "Please install curl." + exit 1 +fi +if ! command -v jq 2>&1 >/dev/null; then + echo "Please install jq." + exit 1 +fi + docker build -f build.Dockerfile -t lemur-build . -MSYS_NO_PATHCONV=1 docker run -it --rm -e RELEASE_TOKEN="${RELEASE_TOKEN}" -v .:/app -w /app --entrypoint bash lemur-build /app/scripts/do-release.sh \ No newline at end of file +MSYS_NO_PATHCONV=1 docker run -it --rm -v .:/app -w /app --entrypoint bash lemur-build /app/scripts/do-bundle.sh + +read -r -d EOF 'body' <