mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-22 02:50:39 +08:00
The symlinking process of `build/upload` was not working, due to the command consuming stdin, and ignoring the subsequent targets platforms. Use `-n` to prevent this, allowing every target binary to be uploaded correctly. The output is also improved for better feedback during the upload process.
60 lines
1.7 KiB
Bash
Executable File
60 lines
1.7 KiB
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
SSH_LOGIN=${SSH_LOGIN:-release}
|
|
SSH_ADDRESS=${SSH_ADDRESS:-$SSH_LOGIN@files.radicle.xyz}
|
|
SSH_KEY="$(rad path)/keys/radicle"
|
|
|
|
main() {
|
|
version="$(build/version)"
|
|
|
|
echo "Uploading Radicle $version..."
|
|
|
|
if [ -z "$version" ]; then
|
|
echo "fatal: empty version number" >&2 ; exit 1
|
|
fi
|
|
|
|
destination="/mnt/radicle/files/releases/$version"
|
|
|
|
# Create remote folder.
|
|
ssh -i "$SSH_KEY" "$SSH_ADDRESS" mkdir -p "$destination"
|
|
# Copy files over.
|
|
scp -i "$SSH_KEY" "build/artifacts/radicle-$version"* "$SSH_ADDRESS:$destination"
|
|
scp -i "$SSH_KEY" build/artifacts/radicle.json "$SSH_ADDRESS:$destination"
|
|
scp -i "$SSH_KEY" "build/heartwood-$version.tar.gz" "$SSH_ADDRESS:$destination"
|
|
|
|
while IFS= read -r target
|
|
do
|
|
archive=$destination/radicle-$version-$target.tar.xz
|
|
symlink=$destination/radicle-$target.tar.xz
|
|
|
|
echo "Creating symlinks for $target.."
|
|
|
|
if ssh -n -i "$SSH_KEY" "$SSH_ADDRESS" ln -snf "$archive" "$symlink"; then
|
|
echo "✓ Created symlink: $symlink"
|
|
else
|
|
echo "✗ Failed to create symlink: $symlink"
|
|
fi
|
|
|
|
if ssh -n -i "$SSH_KEY" "$SSH_ADDRESS" ln -snf "$archive.sig" "$symlink.sig"; then
|
|
echo "✓ Created symlink: $symlink.sig"
|
|
else
|
|
echo "✗ Failed to create symlink: $symlink.sig"
|
|
fi
|
|
|
|
if ssh -n -i "$SSH_KEY" "$SSH_ADDRESS" ln -snf "$archive.sha256" "$symlink.sha256"; then
|
|
echo "✓ Created symlink: $symlink.sha256"
|
|
else
|
|
echo "✗ Failed to create symlink: $symlink.sha256"
|
|
fi
|
|
done < build/TARGETS
|
|
|
|
# TODO(cloudhead): Don't pass `--tags` when we have canonical refs.
|
|
echo "Pushing tags.."
|
|
git push rad --tags
|
|
|
|
echo "Done."
|
|
}
|
|
|
|
main "$@"
|