ci: share Linux restore artifacts before builds [CI]
ci/woodpecker/push/web-build Pipeline was successful
ci/woodpecker/push/verify Pipeline failed
ci/woodpecker/push/dev-image Pipeline failed

This commit is contained in:
justme committed 2026-10-21 13:31:07 +08:00
1 parent a6f9759238
commit 806493567b
13 files changed
+211 -82

No files matched your search

@@ -1,24 +1,13 @@
# Cross-compile Linux binaries on amd64; consumers package these outputs directly.
ARG NATIVEAOT_BUILDER_IMAGE=localhost/moshiro-dotnet10-nativeaot-aotanywhere:ci
FROM --platform=linux/amd64 ${NATIVEAOT_BUILDER_IMAGE} AS toolchain
FROM toolchain AS restore
ARG NATIVEAOT_RESTORE_IMAGE
FROM ${NATIVEAOT_RESTORE_IMAGE} AS restore
WORKDIR /src/backend
COPY restore/backend/ ./
COPY source/backend/ ./
COPY source/packaging/native/msquic/ /src/packaging/native/msquic/
ARG NODE_RID=linux-musl-arm64
ARG STATIC_MSQUIC=true
ENV NUGET_PACKAGES=/root/.nuget/packages
# Layer hits skip restore. A dependency change still reuses downloaded packages.
# Seed an empty cache from the baked toolchain instead of downloading SDK/Zig again.
RUN --mount=type=cache,id=moshiro-nuget,target=/root/.nuget/packages,sharing=locked \
--mount=type=bind,from=toolchain,source=/root/.nuget/packages,target=/opt/nuget-seed,ro \
cp -a --update=none /opt/nuget-seed/. /root/.nuget/packages/ \
&& dotnet restore Agent.Native.proj -r "$NODE_RID" -p:PublishAot=true -p:UseAotAnywhere=true -p:SelfContained=true \
-p:StaticMsQuic="$STATIC_MSQUIC" -p:StaticExecutable="$STATIC_MSQUIC" \
-p:RuntimeFrameworkVersion=10.0.12 -p:InvariantGlobalization=true --artifacts-path /artifacts
FROM restore AS managed
COPY source/backend/ ./
COPY source/packaging/native/msquic/ /src/packaging/native/msquic/
ARG APP_VERSION=0.0.0-dev
ARG MOSHIRO_TAG=
ARG MOSHIRO_COMMIT=