Files
Rūdolfs Ošiņš 5e70f8f2bf httpd: Use releases/httpd/ for release tags
Since desktop was merged in, its `releases/<version>` tags are in our
history too, and `git describe --match='releases/*'` picked up
`releases/0.16.0` as the httpd version. The changelog also leaves out
`desktop/`, otherwise the next one would list its whole history.
2026-10-13 16:53:36 +02:00

66 lines
1.9 KiB
Bash
Executable File

#!/bin/sh
set -e
SSH_LOGIN=${SSH_LOGIN:-release}
SSH_ADDRESS=${SSH_ADDRESS:-$SSH_LOGIN@files.radicle.dev}
SSH_KEY="$(rad path)/keys/radicle"
main() {
version="$("$(dirname "$0")/version")"
echo "Uploading Radicle $version..."
if [ -z "$version" ]; then
echo "fatal: empty version number" >&2
exit 1
fi
# Whether this is a tagged (non-development) build; controls the `latest`
# symlink.
tagged=false
if git describe --exact-match --match='releases/httpd/*' >/dev/null 2>&1; then
tagged=true
fi
# radicle-httpd and radicle-search are released together, each into its own
# sibling release folder so their download URLs stay independent.
for bin in radicle-httpd radicle-search; do
base=/var/www/files.radicle.dev/releases/$bin
echo "Uploading $bin..."
# Create remote folder.
ssh -i $SSH_KEY $SSH_ADDRESS mkdir -p $base/$version
# Copy files over.
scp -i $SSH_KEY "$(dirname "$0")/artifacts/$bin-$version"* $SSH_ADDRESS:$base/$version
scp -i $SSH_KEY "$(dirname "$0")/artifacts/$bin.json" $SSH_ADDRESS:$base/$version
for target in $(cat "$(dirname "$0")/TARGETS"); do
archive=$base/$version/$bin-$version-$target.tar.xz
symlink=$base/$version/$bin-$target.tar.xz
echo "Creating symlinks for $bin $target.."
ssh -i $SSH_KEY $SSH_ADDRESS ln -snf $archive $symlink
ssh -i $SSH_KEY $SSH_ADDRESS ln -snf $archive.sig $symlink.sig
ssh -i $SSH_KEY $SSH_ADDRESS ln -snf $archive.sha256 $symlink.sha256
done
if [ "$tagged" = true ]; then
echo "Creating 'latest' symlink for $bin.."
ssh -i $SSH_KEY $SSH_ADDRESS ln -snf $base/$version $base/latest
else
echo "Skipping 'latest' symlink creation for development build."
fi
done
if [ "$tagged" = true ]; then
echo "Pushing tag releases/httpd/$version.."
git push rad "refs/tags/releases/httpd/$version"
fi
echo "Done."
}
main "$@"