release: ship monero-wallet-rpc beside the binary

This commit is contained in:
agent 2026-09-27 23:56:58 -04:00
commit b60a9dcb1a
No known key found for this signature in database
2 changed files with 108 additions and 24 deletions

View file

@ -191,6 +191,14 @@ jobs:
TARGET: aarch64-unknown-linux-gnu TARGET: aarch64-unknown-linux-gnu
CARGO_TARGET_VOLUME: onionwire-target-aarch64 CARGO_TARGET_VOLUME: onionwire-target-aarch64
BUILD_CONTAINER: onionwire-release-${{ github.run_id }}-aarch64 BUILD_CONTAINER: onionwire-release-${{ github.run_id }}-aarch64
# The official Monero release the app ships beside its own binary. Both
# hashes are pinned here and re-checked at build time: the tarball against
# getmonero's signed hashes.txt, and the extracted binary against its own
# value. Bump all four together (see docs/WALLET.md).
MONERO_TARBALL: monero-linux-armv8-v0.18.5.1.tar.bz2
MONERO_TARBALL_SHA256: c0caf042cb7c7b760f5ad6be188084b59352440b32990a78b8051497b9398dbc
MONERO_ARCHIVE_DIR: monero-aarch64-linux-gnu-v0.18.5.1
MONERO_WALLET_RPC_SHA256: 75e254b8ebd94d1af4a3df1661135347ee61854efec73c197e8aca0ba7a48dbf
steps: steps:
- name: Checkout source - name: Checkout source
uses: https://code.forgejo.org/actions/checkout@v4 uses: https://code.forgejo.org/actions/checkout@v4
@ -212,35 +220,51 @@ jobs:
-e CARGO_TARGET_DIR=/target \ -e CARGO_TARGET_DIR=/target \
-e CARGO_BUILD_JOBS=2 \ -e CARGO_BUILD_JOBS=2 \
-e CARGO_TERM_COLOR=never \ -e CARGO_TERM_COLOR=never \
-e MONERO_TARBALL \
-e MONERO_TARBALL_SHA256 \
-e MONERO_ARCHIVE_DIR \
-e MONERO_WALLET_RPC_SHA256 \
-v "$CARGO_REGISTRY_VOLUME":/usr/local/cargo/registry \ -v "$CARGO_REGISTRY_VOLUME":/usr/local/cargo/registry \
-v "$CARGO_TARGET_VOLUME":/target \ -v "$CARGO_TARGET_VOLUME":/target \
-w /src \ -w /src \
"$RUST_IMAGE" \ "$RUST_IMAGE" \
sh -euxc 'mkdir -p /src && tar xzf - -C /src && cd /src \ sh -euxc 'mkdir -p /src && tar xzf - -C /src && cd /src \
&& apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true update \ && apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true update \
&& apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true install -y --no-install-recommends pkg-config libssl-dev \ && apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true install -y --no-install-recommends pkg-config libssl-dev bzip2 ca-certificates curl \
&& cargo build --release --locked \ && cargo build --release --locked \
&& strip /target/release/onionwire \ && strip /target/release/onionwire \
&& ls -l /target/release/onionwire' && ls -l /target/release/onionwire \
&& curl -fsSL -o /tmp/hashes.txt https://www.getmonero.org/downloads/hashes.txt \
&& grep -E "^$MONERO_TARBALL_SHA256[[:space:]]+$MONERO_TARBALL$" /tmp/hashes.txt \
&& echo "hashes.txt confirms $MONERO_TARBALL" \
&& curl -fsSL -o /tmp/monero.tar.bz2 "https://downloads.getmonero.org/cli/$MONERO_TARBALL" \
&& echo "$MONERO_TARBALL_SHA256 /tmp/monero.tar.bz2" | sha256sum -c - \
&& tar xjf /tmp/monero.tar.bz2 -C /tmp "$MONERO_ARCHIVE_DIR/monero-wallet-rpc" \
&& mv "/tmp/$MONERO_ARCHIVE_DIR/monero-wallet-rpc" /tmp/monero-wallet-rpc \
&& echo "$MONERO_WALLET_RPC_SHA256 /tmp/monero-wallet-rpc" | sha256sum -c - \
&& ls -l /tmp/monero-wallet-rpc'
tar czf - --exclude=./target --exclude=./.git --exclude=./.worktrees \ tar czf - --exclude=./target --exclude=./.git --exclude=./.worktrees \
--exclude=./.ci-tools . \ --exclude=./.ci-tools . \
| docker start -a -i "$BUILD_CONTAINER" | docker start -a -i "$BUILD_CONTAINER"
mkdir -p dist mkdir -p dist
docker cp "$BUILD_CONTAINER:/target/release/onionwire" "dist/onionwire-$TARGET" docker cp "$BUILD_CONTAINER:/target/release/onionwire" "dist/onionwire-$TARGET"
docker cp "$BUILD_CONTAINER:/tmp/monero-wallet-rpc" "dist/monero-wallet-rpc-$TARGET"
docker rm -f "$BUILD_CONTAINER" > /dev/null docker rm -f "$BUILD_CONTAINER" > /dev/null
- name: Pack and checksum - name: Pack and checksum
run: | run: |
set -euo pipefail set -euo pipefail
cd "${GITHUB_WORKSPACE}/dist" cd "${GITHUB_WORKSPACE}/dist"
bytes=$(wc -c < "onionwire-$TARGET") for asset in "onionwire-$TARGET" "monero-wallet-rpc-$TARGET"; do
if [ "$bytes" -eq 0 ]; then bytes=$(wc -c < "$asset")
echo "refusing empty binary onionwire-$TARGET" >&2 if [ "$bytes" -eq 0 ]; then
exit 1 echo "refusing empty binary $asset" >&2
fi exit 1
file "onionwire-$TARGET" fi
sha256sum "onionwire-$TARGET" > "onionwire-$TARGET.sha256" file "$asset"
sha256sum -c "onionwire-$TARGET.sha256" sha256sum "$asset" > "$asset.sha256"
sha256sum -c "$asset.sha256"
done
ls -l ls -l
- name: Upload dist artifact - name: Upload dist artifact
@ -259,6 +283,11 @@ jobs:
TARGET: x86_64-unknown-linux-gnu TARGET: x86_64-unknown-linux-gnu
CARGO_TARGET_VOLUME: onionwire-target-x86_64 CARGO_TARGET_VOLUME: onionwire-target-x86_64
BUILD_CONTAINER: onionwire-release-${{ github.run_id }}-x86_64 BUILD_CONTAINER: onionwire-release-${{ github.run_id }}-x86_64
# Same pin as the aarch64 job, for this target. See docs/WALLET.md.
MONERO_TARBALL: monero-linux-x64-v0.18.5.1.tar.bz2
MONERO_TARBALL_SHA256: 22a7dda7b0cb699fdd6b7674c3b4a4465b337cc98a54983523b759e1e7cc9958
MONERO_ARCHIVE_DIR: monero-x86_64-linux-gnu-v0.18.5.1
MONERO_WALLET_RPC_SHA256: c1e3aff7c72837e6f29045c439b772a82b5cd7324c8b831fa825a6ce2019a656
steps: steps:
- name: Checkout source - name: Checkout source
uses: https://code.forgejo.org/actions/checkout@v4 uses: https://code.forgejo.org/actions/checkout@v4
@ -295,35 +324,51 @@ jobs:
-e CARGO_TARGET_DIR=/target \ -e CARGO_TARGET_DIR=/target \
-e CARGO_BUILD_JOBS=2 \ -e CARGO_BUILD_JOBS=2 \
-e CARGO_TERM_COLOR=never \ -e CARGO_TERM_COLOR=never \
-e MONERO_TARBALL \
-e MONERO_TARBALL_SHA256 \
-e MONERO_ARCHIVE_DIR \
-e MONERO_WALLET_RPC_SHA256 \
-v "$CARGO_REGISTRY_VOLUME":/usr/local/cargo/registry \ -v "$CARGO_REGISTRY_VOLUME":/usr/local/cargo/registry \
-v "$CARGO_TARGET_VOLUME":/target \ -v "$CARGO_TARGET_VOLUME":/target \
-w /src \ -w /src \
"$RUST_IMAGE" \ "$RUST_IMAGE" \
sh -euxc 'mkdir -p /src && tar xzf - -C /src && cd /src \ sh -euxc 'mkdir -p /src && tar xzf - -C /src && cd /src \
&& apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true update \ && apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true update \
&& apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true install -y --no-install-recommends pkg-config libssl-dev \ && apt-get -o Acquire::Retries=5 -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::ForceIPv4=true install -y --no-install-recommends pkg-config libssl-dev bzip2 ca-certificates curl \
&& cargo build --release --locked \ && cargo build --release --locked \
&& strip /target/release/onionwire \ && strip /target/release/onionwire \
&& ls -l /target/release/onionwire' && ls -l /target/release/onionwire \
&& curl -fsSL -o /tmp/hashes.txt https://www.getmonero.org/downloads/hashes.txt \
&& grep -E "^$MONERO_TARBALL_SHA256[[:space:]]+$MONERO_TARBALL$" /tmp/hashes.txt \
&& echo "hashes.txt confirms $MONERO_TARBALL" \
&& curl -fsSL -o /tmp/monero.tar.bz2 "https://downloads.getmonero.org/cli/$MONERO_TARBALL" \
&& echo "$MONERO_TARBALL_SHA256 /tmp/monero.tar.bz2" | sha256sum -c - \
&& tar xjf /tmp/monero.tar.bz2 -C /tmp "$MONERO_ARCHIVE_DIR/monero-wallet-rpc" \
&& mv "/tmp/$MONERO_ARCHIVE_DIR/monero-wallet-rpc" /tmp/monero-wallet-rpc \
&& echo "$MONERO_WALLET_RPC_SHA256 /tmp/monero-wallet-rpc" | sha256sum -c - \
&& ls -l /tmp/monero-wallet-rpc'
tar czf - --exclude=./target --exclude=./.git --exclude=./.worktrees \ tar czf - --exclude=./target --exclude=./.git --exclude=./.worktrees \
--exclude=./.ci-tools . \ --exclude=./.ci-tools . \
| docker start -a -i "$BUILD_CONTAINER" | docker start -a -i "$BUILD_CONTAINER"
mkdir -p dist mkdir -p dist
docker cp "$BUILD_CONTAINER:/target/release/onionwire" "dist/onionwire-$TARGET" docker cp "$BUILD_CONTAINER:/target/release/onionwire" "dist/onionwire-$TARGET"
docker cp "$BUILD_CONTAINER:/tmp/monero-wallet-rpc" "dist/monero-wallet-rpc-$TARGET"
docker rm -f "$BUILD_CONTAINER" > /dev/null docker rm -f "$BUILD_CONTAINER" > /dev/null
- name: Pack and checksum - name: Pack and checksum
run: | run: |
set -euo pipefail set -euo pipefail
cd "${GITHUB_WORKSPACE}/dist" cd "${GITHUB_WORKSPACE}/dist"
bytes=$(wc -c < "onionwire-$TARGET") for asset in "onionwire-$TARGET" "monero-wallet-rpc-$TARGET"; do
if [ "$bytes" -eq 0 ]; then bytes=$(wc -c < "$asset")
echo "refusing empty binary onionwire-$TARGET" >&2 if [ "$bytes" -eq 0 ]; then
exit 1 echo "refusing empty binary $asset" >&2
fi exit 1
file "onionwire-$TARGET" fi
sha256sum "onionwire-$TARGET" > "onionwire-$TARGET.sha256" file "$asset"
sha256sum -c "onionwire-$TARGET.sha256" sha256sum "$asset" > "$asset.sha256"
sha256sum -c "$asset.sha256"
done
ls -l ls -l
- name: Upload dist artifact - name: Upload dist artifact
@ -384,20 +429,28 @@ jobs:
for target in aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu; do for target in aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu; do
src=$(find artifacts -type f -name "onionwire-$target" -print -quit) src=$(find artifacts -type f -name "onionwire-$target" -print -quit)
sum=$(find artifacts -type f -name "onionwire-$target.sha256" -print -quit) sum=$(find artifacts -type f -name "onionwire-$target.sha256" -print -quit)
if [ -z "$src" ] || [ -z "$sum" ]; then wsrc=$(find artifacts -type f -name "monero-wallet-rpc-$target" -print -quit)
wsum=$(find artifacts -type f -name "monero-wallet-rpc-$target.sha256" -print -quit)
if [ -z "$src" ] || [ -z "$sum" ] || [ -z "$wsrc" ] || [ -z "$wsum" ]; then
echo "missing artifact for $target" >&2 echo "missing artifact for $target" >&2
find artifacts -type f >&2 || true find artifacts -type f >&2 || true
exit 1 exit 1
fi fi
cp "$src" "dist/onionwire-$target" cp "$src" "dist/onionwire-$target"
cp "$sum" "dist/onionwire-$target.sha256" cp "$sum" "dist/onionwire-$target.sha256"
cp "$wsrc" "dist/monero-wallet-rpc-$target"
cp "$wsum" "dist/monero-wallet-rpc-$target.sha256"
done done
missing=0 missing=0
for f in \ for f in \
dist/onionwire-aarch64-unknown-linux-gnu \ dist/onionwire-aarch64-unknown-linux-gnu \
dist/onionwire-aarch64-unknown-linux-gnu.sha256 \ dist/onionwire-aarch64-unknown-linux-gnu.sha256 \
dist/monero-wallet-rpc-aarch64-unknown-linux-gnu \
dist/monero-wallet-rpc-aarch64-unknown-linux-gnu.sha256 \
dist/onionwire-x86_64-unknown-linux-gnu \ dist/onionwire-x86_64-unknown-linux-gnu \
dist/onionwire-x86_64-unknown-linux-gnu.sha256 dist/onionwire-x86_64-unknown-linux-gnu.sha256 \
dist/monero-wallet-rpc-x86_64-unknown-linux-gnu \
dist/monero-wallet-rpc-x86_64-unknown-linux-gnu.sha256
do do
bytes=$(wc -c < "$f") bytes=$(wc -c < "$f")
echo "on disk: $f $bytes bytes" echo "on disk: $f $bytes bytes"
@ -416,8 +469,12 @@ jobs:
.ci-tools/scripts/release-body.md \ .ci-tools/scripts/release-body.md \
dist/onionwire-aarch64-unknown-linux-gnu \ dist/onionwire-aarch64-unknown-linux-gnu \
dist/onionwire-aarch64-unknown-linux-gnu.sha256 \ dist/onionwire-aarch64-unknown-linux-gnu.sha256 \
dist/monero-wallet-rpc-aarch64-unknown-linux-gnu \
dist/monero-wallet-rpc-aarch64-unknown-linux-gnu.sha256 \
dist/onionwire-x86_64-unknown-linux-gnu \ dist/onionwire-x86_64-unknown-linux-gnu \
dist/onionwire-x86_64-unknown-linux-gnu.sha256 dist/onionwire-x86_64-unknown-linux-gnu.sha256 \
dist/monero-wallet-rpc-x86_64-unknown-linux-gnu \
dist/monero-wallet-rpc-x86_64-unknown-linux-gnu.sha256
- name: Delete tag we created if this job failed - name: Delete tag we created if this job failed
if: failure() && needs.version.outputs.created_tag == 'true' && needs.version.outputs.dry_run != 'true' if: failure() && needs.version.outputs.created_tag == 'true' && needs.version.outputs.dry_run != 'true'

View file

@ -15,6 +15,17 @@ target=x86_64-unknown-linux-gnu
root="$(cd "$(dirname "$0")/.." && pwd)" root="$(cd "$(dirname "$0")/.." && pwd)"
cd "$root" cd "$root"
# The bundled wallet RPC — the official Monero release binary for this target,
# not something built here (Monero's C++ tree is not part of this build). Both
# values are pinned and both are re-checked on every run: the tarball against
# getmonero's signed hashes.txt, then the extracted binary against its own
# sha256. Bump all four together with the workflow's pins; docs/WALLET.md is the
# provenance record.
monero_tarball=monero-linux-x64-v0.18.5.1.tar.bz2
monero_tarball_sha256=22a7dda7b0cb699fdd6b7674c3b4a4465b337cc98a54983523b759e1e7cc9958
monero_archive_dir=monero-x86_64-linux-gnu-v0.18.5.1
wallet_rpc_sha256=c1e3aff7c72837e6f29045c439b772a82b5cd7324c8b831fa825a6ce2019a656
expected="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)" expected="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)"
if [ "$tag" != "v$expected" ]; then if [ "$tag" != "v$expected" ]; then
echo "warn: tag $tag does not match Cargo.toml version $expected (--version will report $expected)" echo "warn: tag $tag does not match Cargo.toml version $expected (--version will report $expected)"
@ -31,6 +42,22 @@ strip "dist/$asset"
file "dist/$asset" file "dist/$asset"
"dist/$asset" --version "dist/$asset" --version
echo "==> fetching $monero_tarball"
work="$(mktemp -d)"
trap 'rm -rf "$work"' EXIT
curl -fsSL -o "$work/hashes.txt" https://www.getmonero.org/downloads/hashes.txt
grep -E "^$monero_tarball_sha256[[:space:]]+$monero_tarball$" "$work/hashes.txt" > /dev/null
echo "hashes.txt confirms $monero_tarball"
curl -fsSL -o "$work/monero.tar.bz2" "https://downloads.getmonero.org/cli/$monero_tarball"
echo "$monero_tarball_sha256 $work/monero.tar.bz2" | sha256sum -c -
tar xjf "$work/monero.tar.bz2" -C "$work" "$monero_archive_dir/monero-wallet-rpc"
mv "$work/$monero_archive_dir/monero-wallet-rpc" "$work/monero-wallet-rpc"
echo "$wallet_rpc_sha256 $work/monero-wallet-rpc" | sha256sum -c -
wasset="monero-wallet-rpc-$target"
cp "$work/monero-wallet-rpc" "dist/$wasset"
(cd dist && sha256sum "$wasset" > "$wasset.sha256" && sha256sum -c "$wasset.sha256")
file "dist/$wasset"
echo "==> publishing to the release for $tag" echo "==> publishing to the release for $tag"
scripts/publish-release.sh "$tag" "OnionWire $tag" scripts/release-body.md \ scripts/publish-release.sh "$tag" "OnionWire $tag" scripts/release-body.md \
"dist/$asset" "dist/$asset.sha256" "dist/$asset" "dist/$asset.sha256" "dist/$wasset" "dist/$wasset.sha256"