build: Separate release from upload

This commit is contained in:
cloudhead 2024-11-01 12:28:39 +01:00
parent 09f796234d
commit 6dcfbfcdee
No known key found for this signature in database
2 changed files with 40 additions and 7 deletions

39
build/release Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <version-number>"
exit 1
fi
SSH_LOGIN=${SSH_LOGIN:-release}
SSH_ADDRESS=${SSH_ADDRESS:-$SSH_LOGIN@files.radicle.xyz}
SSH_KEY="$(rad path)/keys/radicle"
main() {
version="$1"
if [ -z "$version" ]; then
echo "fatal: empty version number" >&2 ; exit 1
fi
printf "Releasing Radicle %s? [y/N] " "$version"
read confirmation
case "$confirmation" in
[Yy]*)
if git describe --exact-match --match='v*' 2>/dev/null; then
echo "Creating 'latest' symlink.."
ssh -i "$SSH_KEY" "$SSH_ADDRESS" ln -snf /mnt/radicle/files/releases/$version /mnt/radicle/files/releases/latest
else
echo "Release tag must start with 'v'; operation aborted."
exit 1
fi ;;
*)
echo "Operation aborted."
exit 1 ;;
esac
echo "Done."
}
main "$@"

View File

@ -31,13 +31,7 @@ main() {
ssh -i $SSH_KEY $SSH_ADDRESS ln -snf $archive.sha256 $symlink.sha256 ssh -i $SSH_KEY $SSH_ADDRESS ln -snf $archive.sha256 $symlink.sha256
done done
if git describe --exact-match --match='v*' 2>/dev/null; then # TODO(cloudhead): Don't pass `--tags` when we have canonical refs.
echo "Creating 'latest' symlink.."
ssh -i $SSH_KEY $SSH_ADDRESS ln -snf /mnt/radicle/files/releases/$version /mnt/radicle/files/releases/latest
else
echo "Skipping 'latest' symlink creation for development build."
fi
echo "Pushing tags.." echo "Pushing tags.."
git push rad --tags git push rad --tags