Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
Improve Release Process
Merged fintohaps opened 11 months ago

As I tried to test run the release process, there were some issues that I run into. This series of changes resolves them.

4 files changed +43 -10 924b9328 ae1165fa
modified build/Dockerfile
@@ -1,5 +1,8 @@
# Builds release binaries for Radicle.
-
FROM rust:1.80-alpine3.20 as builder
+
ARG RUST_VERSION="1.85"
+
ARG ALPINE_VERSION="3.20"
+

+
FROM rust:${RUST_VERSION}-alpine${ALPINE_VERSION} as builder
LABEL maintainer="Radicle Team <team@radicle.xyz>"
WORKDIR /src
COPY . .
@@ -29,7 +32,7 @@ RUN rustup target add \
# We use Zig as the linker to perform the compilation from a Linux host.
# Zig is not yet available on Debian, so we download the official binary.
# Compilation is done via `cargo-zigbuild` which is a wrapper around `zig`.
-
RUN cargo install --locked cargo-zigbuild@0.19.3
+
RUN cargo install --locked cargo-zigbuild@0.20.0


# Parts of the macOS SDK are required to build Radicle, we make these available
modified build/build
@@ -27,6 +27,7 @@ main() {
  keypath="$(rad path)/keys/radicle.pub"
  version="$(build/version)"
  image=radicle-build-$version
+
  rust_version="$(build/rust-version)"

  if [ ! -f "$keypath" ]; then
    echo "fatal: no key found at $keypath" >&2 ; exit 1
@@ -40,6 +41,7 @@ main() {

  echo "Building image ($image).."
  podman --cgroup-manager=cgroupfs build \
+
    --build-arg "RUST_VERSION=$rust_version" \
    --build-arg SOURCE_DATE_EPOCH \
    --build-arg TZ \
    --build-arg LC_ALL \
added build/rust-version
@@ -0,0 +1,7 @@
+
#!/bin/sh
+

+
if ! version=$(grep -m 1 -oP "channel\s*=\s*\K(.*)" rust-toolchain.toml); then
+
  echo "fatal: no rust version found via rust-toolchain.toml" >&2 ; exit 1
+
fi
+

+
echo "$version"
modified build/upload
@@ -7,6 +7,9 @@ SSH_KEY="$(rad path)/keys/radicle"

main() {
  version="$(build/version)"
+
  nid="$(rad self --nid)"
+
  rad_url="$(rad . | sed s/rad:/rad:\\/\\//)"
+
  rad_remote="$rad_url/$nid"

  echo "Uploading Radicle $version..."

@@ -25,19 +28,37 @@ main() {

  while IFS= read -r target
  do
-
    archive=$destination/radicle-$version-$target.tar.xz
-
    symlink=$destination/radicle-$target.tar.xz
+
      archive=$destination/radicle-$version-$target.tar.xz
+
      symlink=$destination/radicle-$target.tar.xz

-
    echo "Creating symlinks for $target.."
+
      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.
-
  echo "Pushing tags.."
-
  git push rad --tags
+
  # Pushes tags without assuming the remote the user is using. It does this by
+
  # 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."
}