Linux release: .deb and .rpm (AppImage needs a real x86_64 host)
linuxdeploy and the AppImage runtime can't run under QEMU (amd64 emulation on Apple silicon). The build is split into cached steps; the release script uploads .rpm too. The .deb installs cleanly on Debian 12. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
# GITEA_TOKEN=… scripts/gitea-release.sh [dir-with-files] (default ../release/desktop)
|
# GITEA_TOKEN=… scripts/gitea-release.sh [dir-with-files] (default ../release/desktop)
|
||||||
#
|
#
|
||||||
# GITEA_TOKEN: a Gitea access token with the write:repository scope (Settings → Applications). The tag
|
# GITEA_TOKEN: a Gitea access token with the write:repository scope (Settings → Applications). The tag
|
||||||
# v<version> must already be pushed. Files: *.AppImage, *.deb, *-setup.exe, kestrove-nmh-*, SHA256SUMS.
|
# v<version> must already be pushed. Files: *.AppImage, *.deb, *.rpm, *-setup.exe, kestrove-nmh-*, SHA256SUMS.
|
||||||
set -eu
|
set -eu
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
: "${GITEA_TOKEN:?set GITEA_TOKEN (Gitea → Settings → Applications → token with write:repository)}"
|
: "${GITEA_TOKEN:?set GITEA_TOKEN (Gitea → Settings → Applications → token with write:repository)}"
|
||||||
@@ -15,14 +15,14 @@ V=$(node -p 'require("./package.json").version')
|
|||||||
TAG="v$V"
|
TAG="v$V"
|
||||||
AUTH="Authorization: token $GITEA_TOKEN"
|
AUTH="Authorization: token $GITEA_TOKEN"
|
||||||
|
|
||||||
(cd "$DIR" && rm -f SHA256SUMS && shasum -a 256 -- *.AppImage *.deb *-setup.exe kestrove-nmh-* 2>/dev/null > SHA256SUMS; cat SHA256SUMS)
|
(cd "$DIR" && rm -f SHA256SUMS && shasum -a 256 -- *.AppImage *.deb *.rpm *-setup.exe kestrove-nmh-* 2>/dev/null > SHA256SUMS; cat SHA256SUMS)
|
||||||
|
|
||||||
ID=$(curl -fsS -H "$AUTH" "$API/repos/$REPO/releases/tags/$TAG" 2>/dev/null | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{console.log(JSON.parse(s).id||"")}catch{console.log("")}})')
|
ID=$(curl -fsS -H "$AUTH" "$API/repos/$REPO/releases/tags/$TAG" 2>/dev/null | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{console.log(JSON.parse(s).id||"")}catch{console.log("")}})')
|
||||||
if [ -z "$ID" ]; then
|
if [ -z "$ID" ]; then
|
||||||
BODY=$(node -e 'console.log(JSON.stringify({tag_name: process.argv[1], name: "Kestrove " + process.argv[2], body: "Kestrove desktop " + process.argv[2] + " for Windows and Linux. On a Mac, use the Kestrove app from the Mac App Store instead.\n\nVerify downloads with SHA256SUMS.", draft: false, prerelease: false}))' "$TAG" "$V")
|
BODY=$(node -e 'console.log(JSON.stringify({tag_name: process.argv[1], name: "Kestrove " + process.argv[2], body: "Kestrove desktop " + process.argv[2] + " for Windows and Linux. On a Mac, use the Kestrove app from the Mac App Store instead.\n\nVerify downloads with SHA256SUMS.", draft: false, prerelease: false}))' "$TAG" "$V")
|
||||||
ID=$(curl -fsS -X POST -H "$AUTH" -H "Content-Type: application/json" -d "$BODY" "$API/repos/$REPO/releases" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>console.log(JSON.parse(s).id))')
|
ID=$(curl -fsS -X POST -H "$AUTH" -H "Content-Type: application/json" -d "$BODY" "$API/repos/$REPO/releases" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>console.log(JSON.parse(s).id))')
|
||||||
fi
|
fi
|
||||||
for f in "$DIR"/*.AppImage "$DIR"/*.deb "$DIR"/*-setup.exe "$DIR"/kestrove-nmh-* "$DIR"/SHA256SUMS; do
|
for f in "$DIR"/*.AppImage "$DIR"/*.deb "$DIR"/*.rpm "$DIR"/*-setup.exe "$DIR"/kestrove-nmh-* "$DIR"/SHA256SUMS; do
|
||||||
[ -f "$f" ] || continue
|
[ -f "$f" ] || continue
|
||||||
echo "uploading $(basename "$f")"
|
echo "uploading $(basename "$f")"
|
||||||
curl -fsS -X POST -H "$AUTH" -F "attachment=@$f" "$API/repos/$REPO/releases/$ID/assets?name=$(basename "$f")" >/dev/null
|
curl -fsS -X POST -H "$AUTH" -F "attachment=@$f" "$API/repos/$REPO/releases/$ID/assets?name=$(basename "$f")" >/dev/null
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# Linux release bundles (AppImage + .deb) for the Gitea release, built in a clean Debian 12 container:
|
# Linux release bundles (.deb + .rpm) for the Gitea release, built in a clean Debian 12 container:
|
||||||
# docker buildx build --platform linux/amd64 -f kestrove-desktop/scripts/linux.Dockerfile \
|
# docker buildx build --platform linux/amd64 -f kestrove-desktop/scripts/linux.Dockerfile \
|
||||||
# --target out -o type=local,dest=release/desktop ..
|
# --target out -o type=local,dest=release/desktop ..
|
||||||
# Build context = the folder holding kestrove-core and kestrove-desktop. Debian 12's glibc (2.36) keeps
|
# Build context = the folder holding kestrove-core and kestrove-desktop. Debian 12's glibc (2.36) keeps
|
||||||
# the AppImage runnable on most current distributions.
|
# the packages installable on current distributions. No AppImage here: its runtime (and linuxdeploy) can't run
|
||||||
|
# under the QEMU emulation used when building amd64 on Apple silicon; build it on a real x86_64 host.
|
||||||
FROM rust:1-bookworm AS build
|
FROM rust:1-bookworm AS build
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev libxdo-dev \
|
libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev libxdo-dev \
|
||||||
@@ -13,10 +14,13 @@ WORKDIR /src
|
|||||||
COPY kestrove-core kestrove-core
|
COPY kestrove-core kestrove-core
|
||||||
COPY kestrove-desktop kestrove-desktop
|
COPY kestrove-desktop kestrove-desktop
|
||||||
WORKDIR /src/kestrove-desktop
|
WORKDIR /src/kestrove-desktop
|
||||||
RUN npm ci --no-audit --no-fund && npm run tauri build -- --bundles appimage,deb \
|
RUN npm ci --no-audit --no-fund
|
||||||
&& cd src-tauri && cargo build --release --bin kestrove-nmh
|
# Separate steps so a packaging failure keeps the compile in the layer cache.
|
||||||
|
RUN cd src-tauri && cargo build --release --bins
|
||||||
|
RUN npm run tauri build -- --bundles deb
|
||||||
|
RUN npm run tauri build -- --bundles rpm
|
||||||
|
|
||||||
FROM scratch AS out
|
FROM scratch AS out
|
||||||
COPY --from=build /src/kestrove-desktop/src-tauri/target/release/bundle/appimage/*.AppImage /
|
COPY --from=build /src/kestrove-desktop/src-tauri/target/release/bundle/rpm/*.rpm /
|
||||||
COPY --from=build /src/kestrove-desktop/src-tauri/target/release/bundle/deb/*.deb /
|
COPY --from=build /src/kestrove-desktop/src-tauri/target/release/bundle/deb/*.deb /
|
||||||
COPY --from=build /src/kestrove-desktop/src-tauri/target/release/kestrove-nmh /kestrove-nmh-linux-x86_64
|
COPY --from=build /src/kestrove-desktop/src-tauri/target/release/kestrove-nmh /kestrove-nmh-linux-x86_64
|
||||||
|
|||||||
Reference in New Issue
Block a user