diff --git a/Dockerfile.builder b/Dockerfile.builder index e062bc9..c59baec 100644 --- a/Dockerfile.builder +++ b/Dockerfile.builder @@ -21,7 +21,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal ENV PATH="/root/.cargo/bin:$PATH" -# Keep Rust/Tauri builds from saturating the small app server. ENV CARGO_BUILD_JOBS=1 RUN rustup target add x86_64-pc-windows-msvc \ @@ -32,22 +31,23 @@ RUN npm install COPY . . -# Signed updater artifacts are produced by the release pipeline once its -# persistent signing key is available. This builder intentionally packages -# the desktop app itself without creating updater signatures. -RUN node -e "const fs=require('fs'); const p='src-tauri/tauri.conf.json'; const c=JSON.parse(fs.readFileSync(p,'utf8')); c.bundle.createUpdaterArtifacts=false; fs.writeFileSync(p, JSON.stringify(c,null,2)+'\\n')" - +RUN test -n "$TAURI_SIGNING_PRIVATE_KEY" RUN nice -n 10 npm run bundle:windows RUN set -eux; \ mkdir -p /desktop-artifacts; \ win="$(find src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis -maxdepth 1 -type f -name '*-setup.exe' -print -quit)"; \ + sig="$(find src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis -maxdepth 1 -type f -name '*-setup.exe.sig' -print -quit)"; \ test -n "$win"; \ + test -n "$sig"; \ cp "$win" /desktop-artifacts/fieldlens-print-windows-x64-setup.exe; \ + cp "$sig" /desktop-artifacts/fieldlens-print-windows-x64-setup.exe.sig; \ + curl -fsSL https://fieldlens-desktop-linux-build.arrowstack.dev/fieldlens-print-linux-x64.AppImage.sig -o /desktop-artifacts/fieldlens-print-linux-x64.AppImage.sig; \ win_sha="$(sha256sum /desktop-artifacts/fieldlens-print-windows-x64-setup.exe | awk '{print $1}')"; \ sha256sum /desktop-artifacts/fieldlens-print-windows-x64-setup.exe > /desktop-artifacts/SHA256SUMS; \ version="$(node -p "require('./package.json').version")"; \ - printf '{\n "version": "%s",\n "notes": "FieldLens Print desktop update",\n "downloads": {\n "windows-x86_64": {\n "url": "https://fieldlens.arrowstack.dev/downloads/fieldlens-print-windows-x64-setup.exe",\n "sha256": "%s"\n },\n "linux-x86_64-deb": {\n "url": "https://fieldlens-desktop-linux-build.arrowstack.dev/fieldlens-print-linux-x64.deb"\n }\n }\n}\n' "$version" "$win_sha" > /desktop-artifacts/release.json + printf '{\n "version": "%s",\n "notes": "FieldLens Print desktop update",\n "downloads": {\n "windows-x86_64": {\n "url": "https://fieldlens.arrowstack.dev/downloads/fieldlens-print-windows-x64-setup.exe",\n "sha256": "%s"\n },\n "linux-x86_64-deb": {\n "url": "https://fieldlens.arrowstack.dev/downloads/fieldlens-print-linux-x64.deb"\n }\n }\n}\n' "$version" "$win_sha" > /desktop-artifacts/release.json; \ + VERSION="$version" node -e 'const fs=require("fs"); const version=process.env.VERSION; const platforms={ "windows-x86_64": { signature: fs.readFileSync("/desktop-artifacts/fieldlens-print-windows-x64-setup.exe.sig","utf8").trim(), url:"https://fieldlens.arrowstack.dev/downloads/fieldlens-print-windows-x64-setup.exe" }, "linux-x86_64": { signature: fs.readFileSync("/desktop-artifacts/fieldlens-print-linux-x64.AppImage.sig","utf8").trim(), url:"https://fieldlens.arrowstack.dev/downloads/fieldlens-print-linux-x64.AppImage" } }; fs.writeFileSync("/desktop-artifacts/latest.json", JSON.stringify({version,notes:"FieldLens Print desktop update",platforms},null,2)+"\n");' FROM nginx:1.27-alpine COPY --from=build /desktop-artifacts /usr/share/nginx/html diff --git a/Dockerfile.builder-linux b/Dockerfile.builder-linux index 2fc7488..9dc7141 100644 --- a/Dockerfile.builder-linux +++ b/Dockerfile.builder-linux @@ -17,7 +17,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal ENV PATH="/root/.cargo/bin:$PATH" -# Keep Rust/Tauri builds from saturating the small app server. ENV CARGO_BUILD_JOBS=1 COPY package.json ./ @@ -25,17 +24,23 @@ RUN npm install COPY . . -RUN node -e "const fs=require('fs'); const p='src-tauri/tauri.conf.json'; const c=JSON.parse(fs.readFileSync(p,'utf8')); c.bundle.createUpdaterArtifacts=false; fs.writeFileSync(p, JSON.stringify(c,null,2)+'\\n')" - -RUN nice -n 10 npm run bundle:deb +RUN cargo test --manifest-path src-tauri/Cargo.toml --lib +RUN test -n "$TAURI_SIGNING_PRIVATE_KEY" +RUN nice -n 10 npm run bundle:linux RUN set -eux; \ mkdir -p /desktop-artifacts; \ deb="$(find src-tauri/target/release/bundle/deb -maxdepth 1 -type f -name '*.deb' -print -quit)"; \ + appimage="$(find src-tauri/target/release/bundle/appimage -maxdepth 1 -type f -name '*.AppImage' -print -quit)"; \ + sig="$(find src-tauri/target/release/bundle/appimage -maxdepth 1 -type f -name '*.AppImage.sig' -print -quit)"; \ test -n "$deb"; \ + test -n "$appimage"; \ + test -n "$sig"; \ cp "$deb" /desktop-artifacts/fieldlens-print-linux-x64.deb; \ + cp "$appimage" /desktop-artifacts/fieldlens-print-linux-x64.AppImage; \ + cp "$sig" /desktop-artifacts/fieldlens-print-linux-x64.AppImage.sig; \ deb_sha="$(sha256sum /desktop-artifacts/fieldlens-print-linux-x64.deb | awk '{print $1}')"; \ - sha256sum /desktop-artifacts/fieldlens-print-linux-x64.deb > /desktop-artifacts/SHA256SUMS; \ + sha256sum /desktop-artifacts/fieldlens-print-linux-x64.deb /desktop-artifacts/fieldlens-print-linux-x64.AppImage > /desktop-artifacts/SHA256SUMS; \ sed -E "s#EXPECTED_SHA256=\"[0-9a-f]{64}\"#EXPECTED_SHA256=\"$deb_sha\"#" downloads/install.sh > /desktop-artifacts/install.sh; \ chmod 0755 /desktop-artifacts/install.sh; \ version="$(node -p "require('./package.json').version")"; \ diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index db11405..03954d1 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -51,7 +51,7 @@ }, "plugins": { "updater": { - "pubkey": "__FIELDLENS_UPDATER_PUBKEY__", + "pubkey": "RWSIKvrjYbOtAMJ4KKVh3gQEwQf2v4IMDMVL1UPHOS3elKTIt9SdqEKu", "endpoints": [ "https://fieldlens.arrowstack.dev/downloads/latest.json" ],