Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Improve the release pipeline by automating it
Draft did:key:z6MkkfM3...sVz5 opened 10 months ago

debian: Provide a docker container to sign and import new debian packages

Instead of relying on users having the correct toolchain and now the ancient incantations this docker container, allows developers to:

  • Providing a package url, fetch the desired deb package
  • Clone the latest state of the radicle-apt-repo
  • Sign and import the package with the import-deb script
  • Output the dists and pool folder in the desired folder by the user
5 files changed +131 -0 581a9b6a c927c5c7
modified RELEASE.md
@@ -29,6 +29,14 @@
  You’ll get a chance to review the changes. You need to be a maintainer of the
  AUR package to push.
- Verify the Arch package version on the [AUR](https://aur.archlinux.org/packages/radicle-desktop).
+
- Import the apt repo with the latest debian package.
+
- Run `docker build -t radicle-apt-publisher ./debian`
+
- Import and sign the debian package by running the following command:
+

+
```bash
+
docker run -v /path/to/signing/key:/app/keys/signing-key -v /path/to/output/folder:/app/output --env PACKAGE_URL=<url to debian package to import>  radicle-apt-publisher
+
```
+

- Announce the release on Zulip, following the [previous announcement format][3].
- Resolve the previous release topic on Zulip.

added debian/Dockerfile
@@ -0,0 +1,21 @@
+
FROM debian:sid
+

+
RUN apt-get update && apt-get install -y \
+
    curl \
+
    rsop \
+
    jq \
+
    reprepro \
+
    git
+

+
WORKDIR /app
+
RUN mkdir -p /app/output /app/keys
+

+
ENV PACKAGE_URL="https://minio-api.radworks.garden/radworks-releases/radicle-desktop/latest/deb/radicle-desktop-amd64.deb"
+
ENV REPO_URL="https://iris.radicle.xyz/z2nDKoCF4hg6xVrv7v93LmWHDJKUr.git"
+

+
# Copy entrypoint script
+
COPY entrypoint.sh /app/
+
RUN chmod +x /app/entrypoint.sh
+

+
# Define entrypoint
+
ENTRYPOINT ["/app/entrypoint.sh"]
added debian/README.md
@@ -0,0 +1,15 @@
+
# Packaging for Debian
+

+
This folder provides a Docker setup to sign and include the latest debian package into the latest state of `radicle-apt-repo`.
+

+
To build the Docker image:
+

+
```
+
$ docker build -t radicle-apt-publisher ./debian
+
```
+

+
To run the Docker image:
+

+
```
+
$ docker run -v /path/to/signing-key:/app/keys/signing-key -v /path/to/output/folder:/app/output radicle-apt-publisher
+
```
added debian/entrypoint.sh
@@ -0,0 +1,27 @@
+
#!/bin/bash
+
set -e
+

+
if [ ! -f "/app/keys/signing-key" ]; then
+
  echo "Error: GPG signing key not found at /app/keys/signing-key"
+
  echo "Please mount your signing key using: -v /path/to/your/key.gpg:/app/keys/signing-key"
+
  exit 1
+
fi
+

+
echo 'Fetching Radicle Desktop package...'
+
curl -L $PACKAGE_URL -o radicle-desktop.deb
+

+
echo 'Cloning radicle-apt-repo...'
+
git clone $REPO_URL radicle-apt-repo
+

+
echo 'Importing package into repository...'
+
cd radicle-apt-repo
+

+
VERSION=$(curl -L https://minio-api.radworks.garden/radworks-releases/radicle-desktop/latest/latest.json | jq -r '.version')
+
sed -i "s/Version: .*/Version: $VERSION/g" conf/distributions
+

+
RADICLE_APT_SIGNING_KEY="/app/keys/signing-key" ./import-deb ../radicle-desktop.deb
+

+
echo 'Copying repository files to output directory...'
+
cp -r dists pool /app/output/
+
cp -r conf /app/output/
+
echo 'Process completed successfully'
added release.sh
@@ -0,0 +1,60 @@
+
#!/usr/bin/env bash
+
set -e
+

+
# Verify that gum is installed
+
# We probably could do without it, but the file picker and the multiline write editor is just so convenient.
+
if ! command -v gum &> /dev/null; then
+
  echo "gum is not installed. Please install it before proceeding."
+
  echo ""
+
  echo "brew install gum"
+
  echo "pacman -S gum"
+
  echo "nix-env -iA nixpkgs.gum"
+
  echo ""
+
  echo "https://github.com/charmbracelet/gum?tab=readme-ov-file#installation"
+
  exit 1
+
fi
+

+
gum style --padding "1 0 0 0" "Welcome to the radicle-desktop release pipeline!"
+
gum style --padding "1 0" "This script will guide you through the release process."
+

+
VERSION=$(gum input --header "Version" --placeholder "Define the next version (X.Y.Z)")
+
CHANGELOG=$(gum write --header "Changelog" --strip-ansi --placeholder "Details of the changes — only include changes relevant to users.")
+
OS=$(uname)
+

+
# Modify the version field in the tauri configuration file and create the Release commit.
+
sed -i "" "s/\"version\": \".*\"/\"version\": \"$VERSION\"/g" crates/radicle-tauri/tauri.conf.json
+
echo -e "### v$VERSION\n$CHANGELOG\n\n\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
+
git add -A
+
git commit -m "Release v$VERSION"
+
git push rad -o patch.message="Release v$VERSION" HEAD:refs/patches
+

+
case "$OS" in
+
Darwin)
+
  cargo clean && rm -rf node_modules
+
  npm ci && npm run tauri build
+
  ;;
+
*)
+
  echo "We are not able to build Darwin binaries on your machine."
+
  echo "Make sure to find someone you trust that can build a .dmg package of the desktop app at commit $GIT_HEAD."
+
  ;;
+
esac
+

+
SIGNING_KEY=$(gum file --header "Select your APT signing key" $HOME)
+
OUTPUT_FOLDER=$(gum file --directory --header "Output folder for the new debian APT folders" $HOME)
+
PACKAGE_URL=$(gum input --value "http://minio-api.radworks.garden/radworks-releases/radicle-desktop/latest/deb/radicle-desktop-amd64.deb" --placeholder "URL to debian package to be imported")
+
GIT_HEAD=$(git rev-parse HEAD)
+

+
sed -i "" "s/_commit=.*/_commit=$GIT_HEAD/g" arch/radicle-desktop/PKGBUILD
+
cd arch && ./generate-srcinfo.sh && cd ..
+

+
git add -A
+
git commit -m "Update arch package to $VERSION"
+
git push rad -o patch.message="Update arch package to $VERSION" -o patch.base=$GIT_HEAD HEAD:refs/patches
+

+
cd arch && ./publish.sh "Release v$VERSION" && cd ..
+

+
docker run -v $SIGNING_KEY:/app/keys/signing-key -v $OUTPUT_FOLDER:/app/output --env PACKAGE_URL=$PACKAGE_URL $(docker build -q debian/.)
+

+
echo "Announce the release on Zulip, using the following message."
+
gum style --margin "1 0" "@**all** A new release is out :point_right:  [give it a try](https://radicle.xyz/desktop)!" " " "### v$VERSION" " " " $CHANGELOG"
+
echo "PS. Make sure to resolve the previous release announcement."