From f7875713ff0b2b54b2516b9765eddc18c9ae1604 Mon Sep 17 00:00:00 2001 From: monsieurleberre Date: Wed, 2 Sep 2026 09:44:41 +0100 Subject: [PATCH] ci(publish): seed the DAR local feed from the release's own packages The DAR legs generate csprojs that reference Daml.Runtime and Daml.Ledger.Abstractions at the version this same release pushed moments earlier, then resolve them from nuget.org. nuget.org accepts a package immediately but does not serve it to restore until indexing completes, so the legs race an external queue: the packages are already downloadable while restore still reports the previous version as the newest available. Losing that race fails every pack, including leaf packages with no sibling dependencies -- 41 of them on the last tag, with the unauthenticated github source turning the lookup miss into a hard NU1301. The local feed already sits ahead of nuget.org in the generated NuGet.config and already carries sibling DAR packages, so seed it with the core nupkgs attached to the release being built. Restores then resolve the exact bits that were published rather than whatever nuget.org happens to be serving, and the indexing delay stops mattering. Seeding is best-effort: a run whose release has no attached packages warns and behaves exactly as it does today. --- .github/workflows/_publish-dar-packages.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/_publish-dar-packages.yaml b/.github/workflows/_publish-dar-packages.yaml index 1e0e5d7..02ebc24 100644 --- a/.github/workflows/_publish-dar-packages.yaml +++ b/.github/workflows/_publish-dar-packages.yaml @@ -151,6 +151,22 @@ jobs: GH_TOKEN: ${{ secrets.COUNTERS_TOKEN }} run: .github/scripts/fetch-counters.sh + - name: Seed the local feed with this release's core packages + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_TAG_INPUT: ${{ inputs.release_tag }} + run: | + set -euo pipefail + FEED="$RUNNER_TEMP/local-feed" + TAG="${RELEASE_TAG_INPUT:-v${CODEGEN_CS_VERSION}}" + mkdir -p "$FEED" + if gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern '*.nupkg' --dir "$FEED" --clobber; then + echo "Seeded the local feed from $TAG:" + ls -1 "$FEED" + else + echo "::warning::could not seed the local feed from $TAG; restores fall back to nuget.org, which does not serve a just-pushed version until it finishes indexing" + fi + - name: Generate, build, pack (multi-pass) via dpm codegen-cs env: DOTNET_NOLOGO: 1