fix(deploy): retry publish after clearing NuGet caches on NU3008 #5

Merged
cesnimda merged 2 commits from fix/deploy-nuget-integrity into main 2026-07-06 01:12:06 +02:00
2 changed files with 14 additions and 2 deletions
+6 -1
View File
@@ -39,7 +39,12 @@ jobs:
run: | run: |
node -v node -v
npm -v npm -v
npm ci --no-audit --no-fund # npm ci occasionally segfaults on the runner (SIGSEGV/139, a memory/native
# flake). Retry once with a clean node_modules before failing the job.
npm ci --no-audit --no-fund \
|| ( echo "npm ci failed ($?) — cleaning node_modules and retrying once..." \
&& rm -rf node_modules \
&& npm ci --no-audit --no-fund )
- name: Test frontend - name: Test frontend
working-directory: job-tracker-ui working-directory: job-tracker-ui
+8 -1
View File
@@ -9,7 +9,14 @@ COPY Models/ Models/
COPY JobTrackerApi/ JobTrackerApi/ COPY JobTrackerApi/ JobTrackerApi/
COPY JobTrackerBackend/ JobTrackerBackend/ COPY JobTrackerBackend/ JobTrackerBackend/
RUN dotnet publish JobTrackerApi/JobTrackerApi.csproj -c Release -o /app/publish /p:UseAppHost=false # Retry once after clearing NuGet caches. Transient download corruption on the
# build host can trip NU3008 ("package integrity check failed / has changed since
# it was signed") while restoring a transitive package; clearing the caches and
# re-downloading resolves it.
RUN dotnet publish JobTrackerApi/JobTrackerApi.csproj -c Release -o /app/publish /p:UseAppHost=false \
|| ( echo "Publish failed — clearing NuGet caches and retrying once..." \
&& dotnet nuget locals all --clear \
&& dotnet publish JobTrackerApi/JobTrackerApi.csproj -c Release -o /app/publish /p:UseAppHost=false )
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime