Skip to content

Commit 818a652

Browse files
committed
fix(ci): restore --no-restore drop + build-number offset to keep continuity
- Dockerfile: drop --no-restore on dotnet publish. BuildKit cache mounts only exist for the duration of a single RUN, so the cache from the prior 'dotnet restore' is gone when 'publish' starts; passing --no-restore made publish fail with NETSDK1064 (package not found). Re-mounting the cache keeps the second restore essentially free. - main.yml + feature.yml: add +247 offset to github.run_number so numbering continues from the previous git-count value (~252) instead of restarting at 1. Fixes failing main.yml run #5.
1 parent 760fa02 commit 818a652

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/feature.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ jobs:
6060
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
6161
echo "tag_branch=$TAG_BRANCH" >> $GITHUB_OUTPUT
6262
echo "sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
63-
echo "build=${{ github.run_number }}" >> $GITHUB_OUTPUT
63+
# Offset so we keep numbering continuous after switching from
64+
# `git rev-list --count HEAD` (which had reached 252) to run_number
65+
# (which restarted at 1 when the workflow file was renamed).
66+
echo "build=$(( ${{ github.run_number }} + 247 ))" >> $GITHUB_OUTPUT
6467
6568
- name: Set up Docker Buildx
6669
uses: docker/setup-buildx-action@v4

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ jobs:
4747
id: meta
4848
run: |
4949
echo "sha=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
50-
echo "build=${{ github.run_number }}" >> $GITHUB_OUTPUT
50+
# Offset so we keep numbering continuous after switching from
51+
# `git rev-list --count HEAD` (which had reached 252) to run_number
52+
# (which restarted at 1 when the workflow file was renamed).
53+
echo "build=$(( ${{ github.run_number }} + 247 ))" >> $GITHUB_OUTPUT
5154
5255
- name: Set up Docker Buildx
5356
uses: docker/setup-buildx-action@v4

src/Dashboard/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,12 @@ RUN --mount=type=cache,target=/root/.nuget/packages \
2020
dotnet restore -r linux-x64
2121
COPY . .
2222
COPY --from=frontend /app/wwwroot ./wwwroot/
23+
# Note: we deliberately do NOT pass --no-restore here. BuildKit cache mounts
24+
# only exist for the duration of a single RUN, so the restore step above
25+
# can't share its /root/.nuget/packages with this step. Re-mounting the
26+
# cache makes the second restore essentially free (everything cache-hits).
2327
RUN --mount=type=cache,target=/root/.nuget/packages \
24-
dotnet publish -c Release -r linux-x64 --self-contained false --no-restore -o /app/publish
28+
dotnet publish -c Release -r linux-x64 --self-contained false -o /app/publish
2529

2630
# ── Stage 3: Final runtime image ──
2731
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final

0 commit comments

Comments
 (0)