build: do not assume `rad` remote

Do not assume the `rad` remote being present, in case other use other naming
remote schemes. Instead, build the remote using the `rad .` and `rad self --nid`
commands.
This commit is contained in:
Fintan Halpenny 2025-05-26 14:04:13 +02:00 committed by Erik Kundt
parent edcfcae78c
commit ae1165fa58
1 changed files with 9 additions and 2 deletions

View File

@ -7,6 +7,9 @@ SSH_KEY="$(rad path)/keys/radicle"
main() { main() {
version="$(build/version)" version="$(build/version)"
nid="$(rad self --nid)"
rad_url="$(rad . | sed s/rad:/rad:\\/\\//)"
rad_remote="$rad_url/$nid"
echo "Uploading Radicle $version..." echo "Uploading Radicle $version..."
@ -50,8 +53,12 @@ main() {
done < build/TARGETS done < build/TARGETS
# TODO(cloudhead): Don't pass `--tags` when we have canonical refs. # TODO(cloudhead): Don't pass `--tags` when we have canonical refs.
echo "Pushing tags.." # Pushes tags without assuming the remote the user is using. It does this by
git push rad --tags # using the pushurl directly, i.e.
# `rad://z3gqcJUoA1n9HaHKufZs5FCSGazv5/<nid>`, where `<nid>` is the local Node
# ID.
echo "Pushing tags to ${rad_remote}.."
git push "${rad_remote}" --tags
echo "Done." echo "Done."
} }