- ci/sign-windows.sh signs alkane-toolkit.exe from Linux with jsign through the blueflaresigning account (RFC 3161 timestamped), using the least-privilege CI service principal alkane-toolkit-ci-signer. It is a no-op until the repository variable AZURE_SIGNING_PROFILE names a certificate profile; after that any signing failure fails the build. - release.yml and next.yml sign before packaging; windows-native.yml checks the signature with Get-AuthenticodeSignature on real Windows and requires Valid once signing is on. - CI image adds a Java runtime and a checksum-pinned jsign 7.6 (re-pinned); windows-ci.sh fetches the same jar on older images. - scripts/enable-windows-signing.sh turns signing on after Microsoft approves the publisher identity validation: creates the PublicTrust certificate profile, narrows the signer role to it, sets the variable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
3.1 KiB
Docker
60 lines
3.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
# Alkane Toolkit CI image (ci/runner-image.txt pins the pushed digest).
|
|
#
|
|
# Layered on the previously verified image, so every Linux job keeps exactly
|
|
# the toolchain it had (Rust 1.97.1, prebuilt wxGTK prefix, sccache,
|
|
# cargo-llvm-cov), and adds what the Windows jobs need:
|
|
# - mingw-w64 (posix threads) and the rustup target x86_64-pc-windows-gnu
|
|
# - a prebuilt static wxMSW 3.3.3 prefix, built from the vendored source by
|
|
# scripts/build-wx-windows.sh and stamped with the source digest the same
|
|
# way as the wxGTK prefix (ci/ensure-wx-prefix.sh rebuilds on a mismatch)
|
|
# - Wine with an initialised prefix, to run the Windows tests and self-test
|
|
# - a Java runtime and jsign (checksum-pinned), to Authenticode-sign the .exe
|
|
# through Azure Artifact Signing (ci/sign-windows.sh)
|
|
#
|
|
# Build and push from the workstation with ci/images/build-image.sh.
|
|
ARG BASE=gitea.bluefla.re/blueflare/alkane-ci@sha256:9d2a992bbcb91014af3c85d2e1ec8c5990701cecf83fd06c8d46f9ef13dbd948
|
|
FROM ${BASE}
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get update -qq \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
|
|
gcc-mingw-w64-x86-64-posix g++-mingw-w64-x86-64-posix \
|
|
binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev \
|
|
wine wine64 xvfb xauth openjdk-21-jre-headless \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# jsign (Maven Central net.jsign:jsign; keep in step with ci/windows-ci.sh).
|
|
ARG JSIGN_VERSION=7.6
|
|
ARG JSIGN_SHA256=6cf58aa080e7ff82656f320cff8d4a3bff30408df8766806dcba3740dd839fa5
|
|
RUN mkdir -p /opt/jsign \
|
|
&& curl -sSfL -o /opt/jsign/jsign.jar \
|
|
"https://repo1.maven.org/maven2/net/jsign/jsign/${JSIGN_VERSION}/jsign-${JSIGN_VERSION}.jar" \
|
|
&& echo "${JSIGN_SHA256} /opt/jsign/jsign.jar" | sha256sum -c - \
|
|
&& java -jar /opt/jsign/jsign.jar --help >/dev/null
|
|
|
|
RUN rustup target add x86_64-pc-windows-gnu
|
|
|
|
# The build context is the repository root, filtered by
|
|
# alkane-ci.Dockerfile.dockerignore down to the wx source and its build script.
|
|
COPY thirdparty/wxwidgets /tmp/alkane/thirdparty/wxwidgets
|
|
COPY scripts/build-wx-windows.sh /tmp/alkane/scripts/build-wx-windows.sh
|
|
RUN HOME=/root WX_WINDOWS_PREFIX=/root/.cache/wx-3.3.3-mingw \
|
|
sh /tmp/alkane/scripts/build-wx-windows.sh \
|
|
&& awk '$1 == "sha256:" {print $2}' /tmp/alkane/thirdparty/wxwidgets/VERSION \
|
|
> /root/.cache/wx-3.3.3-mingw/.alkane-source-sha256 \
|
|
&& rm -rf /tmp/alkane
|
|
|
|
# A ready Wine prefix saves ~10 s per job (scripts/wine-run.sh reuses it).
|
|
RUN WINEPREFIX=/root/.cache/alkane-wine WINEDEBUG=-all \
|
|
WINEDLLOVERRIDES='winemenubuilder.exe=d;mscoree=d;mshtml=d' \
|
|
sh -c 'wineboot --init; wineboot --shutdown; wineserver -w' >/dev/null 2>&1; \
|
|
test -f /root/.cache/alkane-wine/system.reg
|
|
|
|
RUN test -s /root/.cache/wx-3.3.3-mingw/lib/libwx_mswu-3.3-x86_64-w64-mingw32.a \
|
|
&& test "$(/root/.cache/wx-3.3.3-mingw/bin/wx-config --version)" = 3.3.3 \
|
|
&& test -s /root/.cache/wx-3.3.3-linux/lib/libwx_gtk3u-3.3.a \
|
|
&& x86_64-w64-mingw32-g++-posix --version >/dev/null \
|
|
&& wine --version \
|
|
&& test -s /opt/jsign/jsign.jar \
|
|
&& rustup target list --installed | grep -qx x86_64-pc-windows-gnu
|