build: fix ssh symlinking

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.
This commit is contained in:
Fintan Halpenny 2025-05-26 14:01:20 +02:00 committed by Erik Kundt
parent 40e9b7ba3a
commit edcfcae78c
1 changed files with 17 additions and 3 deletions

View File

@ -30,9 +30,23 @@ main() {
echo "Creating symlinks for $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"
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.