2023-03-25 14:58:20 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
scriptDir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)
|
|
|
|
cd "$scriptDir"
|
|
|
|
|
2024-07-14 11:56:43 +00:00
|
|
|
releaseName="$1"
|
|
|
|
if [ -z "$releaseName" ]; then
|
2024-12-20 12:34:45 +00:00
|
|
|
echo "USAGE: $0 \"0.1.2\" [build number]"
|
2024-07-14 11:56:43 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-03-25 14:58:20 +00:00
|
|
|
|
2024-12-20 12:34:45 +00:00
|
|
|
buildNumber="$2"
|
|
|
|
if [ -z "$buildNumber" ]; then
|
|
|
|
buildNumber="0"
|
|
|
|
fi
|
|
|
|
|
2023-03-25 14:58:20 +00:00
|
|
|
releasesDir="$(pwd)/releases"
|
|
|
|
mkdir -p "$releasesDir"
|
|
|
|
echo '*' > "$releasesDir"/.gitignore
|
|
|
|
|
2024-12-20 12:34:45 +00:00
|
|
|
out="$releasesDir/$releaseName-$buildNumber"
|
|
|
|
rm -rf "$out"
|
2023-08-30 16:24:09 +00:00
|
|
|
|
2024-03-11 22:22:42 +00:00
|
|
|
result=$(nix-build -v \
|
2023-03-25 14:58:20 +00:00
|
|
|
--argstr releaseName "$releaseName" \
|
2024-12-20 12:34:45 +00:00
|
|
|
--argstr buildNumber "$buildNumber" \
|
2023-03-25 14:58:20 +00:00
|
|
|
--no-out-link \
|
|
|
|
release.nix \
|
|
|
|
)
|
|
|
|
|
|
|
|
cp -rL "$result" "$out"
|
|
|
|
chmod u+w -R "$out"
|
|
|
|
|
|
|
|
cd "$out"
|
|
|
|
gpg -a --detach-sign -o sha256.txt.gpg ./sha256.txt
|
|
|
|
|
|
|
|
echo "Release successfully created: $out"
|