From 4262fd6d71386bd994256627d94e468988b363db Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Fri, 20 Mar 2026 18:07:34 +0100 Subject: [PATCH 1/5] [Fix] Correzione versioning CI/CD: fetch completo storia Git per MinVer Aggiunto fetch-depth: 0 al checkout in tutti i job dei workflow GitHub Actions e Gitea Actions. Rimosso --depth 1 dal clone manuale del job Windows in Gitea. MinVer necessita della storia completa per risalire ai tag Git e calcolare la versione corretta. Senza questa correzione la versione risultava sempre 2.1.0 (fallback hardcoded). Aggiornato anche il valore di fallback da 2.1.0 a 2.3.2. --- .gitea/workflows/docker-build.yml | 8 +++++--- .github/workflows/docker-build.yml | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 60c6976..d8faef3 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -30,6 +30,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Necessario per MinVer: deve percorrere tutta la storia Git per trovare i tag - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -51,7 +53,7 @@ jobs: # Fallback if MinVer fails (no tags) if [ -z "$VERSION" ] || [ "$VERSION" = "0.0.0-alpha.0" ]; then echo "Warning: No git tags found. MinVer returned default. Using fallback." - VERSION="2.1.0-alpha.0.$(git rev-list --count HEAD)" + VERSION="2.3.2-alpha.0.$(git rev-list --count HEAD)" fi echo "MinVer calculated version: $VERSION" @@ -159,7 +161,7 @@ jobs: steps: - name: Checkout repository with Git run: | - git clone --depth 1 --branch ${{ github.ref_name }} https://alessio:%REGISTRY_TOKEN%@gitea.home-nas-ds.org/${{ github.repository }}.git . + git clone --branch ${{ github.ref_name }} https://alessio:%REGISTRY_TOKEN%@gitea.home-nas-ds.org/${{ github.repository }}.git . if not exist Dockerfile.windows ( echo ERROR: Dockerfile.windows not found exit /b 1 @@ -191,7 +193,7 @@ jobs: if ([string]::IsNullOrWhiteSpace($VERSION) -or $VERSION -eq "0.0.0-alpha.0") { Write-Host "Warning: No git tags found. MinVer returned default. Using fallback." $commitCount = git rev-list --count HEAD - $VERSION = "2.1.0-alpha.0.$commitCount" + $VERSION = "2.3.2-alpha.0.$commitCount" } Write-Host "MinVer calculated version: $VERSION" diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index d6c2cd9..0815628 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -31,6 +31,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Necessario per MinVer: deve percorrere tutta la storia Git per trovare i tag - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -95,6 +97,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + with: + fetch-depth: 0 # Necessario per MinVer: deve percorrere tutta la storia Git per trovare i tag - name: Log in to GitHub Container Registry uses: docker/login-action@v3 -- 2.52.0 From c15e6c9065a3cba500c9f5b3203d25c39329f1c8 Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Fri, 20 Mar 2026 18:25:54 +0100 Subject: [PATCH 2/5] [Fix] Passa versione MinVer come build-arg al Docker per evitare errore MINVER1001 Il problema era che MinVer veniva eseguito dentro il container Docker dove la directory .git non esiste, causando il warning MINVER1001 e l'uso di 0.0.0-alpha.0 (poi sostituito dal fallback hardcoded 2.1.0). Soluzione: - La versione viene calcolata sul runner CI/CD (dove git e' disponibile) - Esportata come variabile d'ambiente APP_VERSION via GITHUB_ENV - Passata al Docker build tramite --build-arg APP_VERSION - Nei Dockerfile aggiunto ARG APP_VERSION e /p:MinVerVersionOverride per imporla a MinVer senza che tenti di accedere a git (assente nel container) - ARG ridichiarato dopo ogni FROM in multi-stage build (comportamento Docker) --- .gitea/workflows/docker-build.yml | 10 ++++++++- .github/workflows/docker-build.yml | 34 +++++++++++++++++++++++++++++- Dockerfile | 9 ++++++-- Dockerfile.windows | 8 +++++-- 4 files changed, 55 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index d8faef3..d1107f9 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -72,6 +72,9 @@ jobs: echo "Generated version.json:" cat wwwroot/version.json cd .. + + # Esporta la versione come variabile d'ambiente per il Docker build + echo "APP_VERSION=$VERSION" >> "$GITHUB_ENV" shell: bash - name: Set up Docker Buildx @@ -138,6 +141,7 @@ jobs: platforms: linux/amd64 # Aumenta timeout per registry lenti build-args: | + APP_VERSION=${{ env.APP_VERSION }} BUILDKIT_STEP_LOG_MAX_SIZE=50000000 provenance: false sbom: false @@ -217,6 +221,10 @@ jobs: Write-Host "Generated version.json:" Get-Content "wwwroot\version.json" cd .. + + # Esporta la versione come variabile d'ambiente per il Docker build + "APP_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + Write-Host "APP_VERSION=$VERSION esportata per Docker build" shell: pwsh - name: Debug - Verify files @@ -267,7 +275,7 @@ jobs: ) echo Building Windows Docker image... - docker build -t temp-windows -f Dockerfile.windows . + docker build --build-arg APP_VERSION=%APP_VERSION% -t temp-windows -f Dockerfile.windows . if errorlevel 1 ( echo Build failed! exit /b 1 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 0815628..b53762c 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -34,6 +34,23 @@ jobs: with: fetch-depth: 0 # Necessario per MinVer: deve percorrere tutta la storia Git per trovare i tag + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0.x' + + - name: Calcola versione con MinVer + run: | + git fetch --tags --force + VERSION=$(cd Data_Coupler && dotnet msbuild -getProperty:Version -p:ContinuousIntegrationBuild=true 2>/dev/null | tail -1) + if [ -z "$VERSION" ] || [ "$VERSION" = "0.0.0-alpha.0" ]; then + echo "Warning: MinVer non ha trovato tag. Uso fallback." + VERSION="2.3.2-alpha.0.$(git rev-list --count HEAD)" + fi + echo "Versione calcolata: $VERSION" + echo "APP_VERSION=$VERSION" >> "$GITHUB_ENV" + shell: bash + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -77,6 +94,8 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64 + build-args: | + APP_VERSION=${{ env.APP_VERSION }} - name: Generate artifact attestation if: github.event_name != 'pull_request' @@ -100,6 +119,19 @@ jobs: with: fetch-depth: 0 # Necessario per MinVer: deve percorrere tutta la storia Git per trovare i tag + - name: Calcola versione con MinVer + run: | + git fetch --tags --force + $VERSION = (cd Data_Coupler; dotnet msbuild -getProperty:Version -p:ContinuousIntegrationBuild=true 2>$null | Select-Object -Last 1) + if ([string]::IsNullOrWhiteSpace($VERSION) -or $VERSION -eq "0.0.0-alpha.0") { + Write-Host "Warning: MinVer non ha trovato tag. Uso fallback." + $commitCount = git rev-list --count HEAD + $VERSION = "2.3.2-alpha.0.$commitCount" + } + Write-Host "Versione calcolata: $VERSION" + "APP_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + shell: pwsh + - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: @@ -132,7 +164,7 @@ jobs: $imageName = "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}".ToLower() # Build with temporary tag - docker build -t "${imageName}:temp-windows" -f Dockerfile.windows . + docker build --build-arg "APP_VERSION=$env:APP_VERSION" -t "${imageName}:temp-windows" -f Dockerfile.windows . # Parse and push all tags $tags = "${{ steps.meta.outputs.tags }}" -split "`n" diff --git a/Dockerfile b/Dockerfile index 6534981..eef2153 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,8 @@ # Stage 1: Build FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +# Versione calcolata da MinVer sul runner CI/CD e passata come build-arg +ARG APP_VERSION=0.0.0-alpha.0 WORKDIR /src # Copia i file di progetto e ripristina le dipendenze @@ -20,15 +22,18 @@ COPY . . # Build del progetto principale WORKDIR "/src/Data_Coupler" -RUN dotnet build "Data_Coupler.csproj" -c Release -o /app/build /p:ContinuousIntegrationBuild=true +RUN dotnet build "Data_Coupler.csproj" -c Release -o /app/build /p:ContinuousIntegrationBuild=true /p:MinVerVersionOverride=${APP_VERSION} # Stage 2: Publish FROM build AS publish +# Necessario ridichiarare ARG dopo FROM in multi-stage build +ARG APP_VERSION=0.0.0-alpha.0 RUN dotnet publish "Data_Coupler.csproj" -c Release -o /app/publish \ /p:SelfContained=false \ /p:PublishTrimmed=false \ /p:PublishSingleFile=false \ - /p:ContinuousIntegrationBuild=true + /p:ContinuousIntegrationBuild=true \ + /p:MinVerVersionOverride=${APP_VERSION} # Stage 3: Runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final diff --git a/Dockerfile.windows b/Dockerfile.windows index 402475d..845b62d 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -3,6 +3,8 @@ # Stage 1: Build FROM mcr.microsoft.com/dotnet/sdk:9.0-nanoserver-ltsc2022 AS build +# Versione calcolata da MinVer sul runner CI/CD e passata come build-arg +ARG APP_VERSION=0.0.0-alpha.0 WORKDIR /s # Copia i file di progetto e ripristina le dipendenze con nomi originali @@ -23,11 +25,13 @@ COPY ["Components/", "Components/"] # Build del progetto principale con output path corto WORKDIR "/s/Data_Coupler" -RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore +RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore /p:MinVerVersionOverride=%APP_VERSION% # Stage 2: Publish FROM build AS publish -RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false +# Necessario ridichiarare ARG dopo FROM in multi-stage build +ARG APP_VERSION=0.0.0-alpha.0 +RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false /p:MinVerVersionOverride=%APP_VERSION% # Stage 3: Runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final -- 2.52.0 From e125e758fbfd259dd7b41f6738e53dde47e1fca0 Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Sun, 22 Mar 2026 15:49:42 +0100 Subject: [PATCH 3/5] [Fix] Refactoring calcolo versione CI/CD: usa git describe invece di dotnet msbuild Problemi risolti: - GitHub Windows: errore PowerShell 'Missing closing )' causato da (cd Dir; cmd) sintassi bash non valida in PowerShell - GitHub Linux: versione 1.0.0 invece di 2.3.2 perche il tag v2.3.2 esiste solo su Gitea e non su GitHub, quindi MinVer trovava il vecchio tag v1.0.0 Soluzione: - Sostituito dotnet msbuild -getProperty:Version con git describe --tags --abbrev=0 che e lo strumento nativo Git per ottenere l'ultimo tag raggiungibile - Funziona identicamente su Linux (bash) e Windows (PowerShell) - Non richiede dotnet installato ne accesso al .git dentro Docker - Rimosso il dotnet build intermedio sul runner (non piu necessario) - Corretti i percorsi version.json: ora usa Data_Coupler/wwwroot/version.json dal root del repo invece di wwwroot/ relativo dopo cd --- .gitea/workflows/docker-build.yml | 63 ++++++++++++------------------ .github/workflows/docker-build.yml | 29 ++++++++------ 2 files changed, 40 insertions(+), 52 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index d1107f9..94d7d7d 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -38,28 +38,22 @@ jobs: with: dotnet-version: '9.0.x' - - name: Generate version.json with MinVer + - name: Calcola versione e genera version.json run: | - # Fetch all tags for MinVer to work correctly + # Calcola versione tramite git describe (non richiede dotnet build) git fetch --tags --force - - # Build project to trigger MinVer (calcola versione automaticamente) - cd Data_Coupler - dotnet build -c Release /p:ContinuousIntegrationBuild=true - - # Extract version calculated by MinVer from build output - VERSION=$(dotnet msbuild -getProperty:Version -p:ContinuousIntegrationBuild=true 2>/dev/null | tail -1) - - # Fallback if MinVer fails (no tags) - if [ -z "$VERSION" ] || [ "$VERSION" = "0.0.0-alpha.0" ]; then - echo "Warning: No git tags found. MinVer returned default. Using fallback." - VERSION="2.3.2-alpha.0.$(git rev-list --count HEAD)" + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + if [ -z "$LATEST_TAG" ]; then + echo "Warning: Nessun tag Git trovato. Uso fallback." + VERSION="2.3.2" + else + VERSION="${LATEST_TAG#v}" fi - echo "MinVer calculated version: $VERSION" + echo "Versione calcolata: $VERSION (da tag: $LATEST_TAG)" - # Create version.json - cat > wwwroot/version.json < Data_Coupler/wwwroot/version.json <> "$GITHUB_ENV" @@ -181,33 +174,26 @@ jobs: dotnet --version shell: pwsh - - name: Generate version.json with MinVer + - name: Calcola versione e genera version.json run: | - # Fetch all tags for MinVer to work correctly + # Calcola versione tramite git describe (non richiede dotnet build) git fetch --tags --force - - # Build project to trigger MinVer - cd Data_Coupler - dotnet build -c Release /p:ContinuousIntegrationBuild=true - - # Extract version calculated by MinVer - $VERSION = dotnet msbuild -getProperty:Version -p:ContinuousIntegrationBuild=true 2>$null | Select-Object -Last 1 - - # Fallback if MinVer fails (no tags) - if ([string]::IsNullOrWhiteSpace($VERSION) -or $VERSION -eq "0.0.0-alpha.0") { - Write-Host "Warning: No git tags found. MinVer returned default. Using fallback." - $commitCount = git rev-list --count HEAD - $VERSION = "2.3.2-alpha.0.$commitCount" + $LATEST_TAG = git describe --tags --abbrev=0 2>$null + if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($LATEST_TAG)) { + Write-Host "Warning: Nessun tag Git trovato. Uso fallback." + $VERSION = "2.3.2" + } else { + $VERSION = $LATEST_TAG -replace '^v', '' } - Write-Host "MinVer calculated version: $VERSION" + Write-Host "Versione calcolata: $VERSION (da tag: $LATEST_TAG)" $COMMIT_SHA = "${{ github.sha }}" $SHORT_SHA = $COMMIT_SHA.Substring(0, 7) $BRANCH = "${{ github.ref_name }}" $BUILD_DATE = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss UTC") - # Create version.json + # Genera version.json $versionJson = @{ version = $VERSION commitSha = $SHORT_SHA @@ -216,11 +202,10 @@ jobs: buildEnvironment = "Gitea Actions" } | ConvertTo-Json - $versionJson | Out-File -FilePath "wwwroot\version.json" -Encoding UTF8 + $versionJson | Out-File -FilePath "Data_Coupler\wwwroot\version.json" -Encoding UTF8 Write-Host "Generated version.json:" - Get-Content "wwwroot\version.json" - cd .. + Get-Content "Data_Coupler\wwwroot\version.json" # Esporta la versione come variabile d'ambiente per il Docker build "APP_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index b53762c..4b07830 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -39,15 +39,17 @@ jobs: with: dotnet-version: '9.0.x' - - name: Calcola versione con MinVer + - name: Calcola versione run: | git fetch --tags --force - VERSION=$(cd Data_Coupler && dotnet msbuild -getProperty:Version -p:ContinuousIntegrationBuild=true 2>/dev/null | tail -1) - if [ -z "$VERSION" ] || [ "$VERSION" = "0.0.0-alpha.0" ]; then - echo "Warning: MinVer non ha trovato tag. Uso fallback." - VERSION="2.3.2-alpha.0.$(git rev-list --count HEAD)" + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + if [ -z "$LATEST_TAG" ]; then + echo "Warning: Nessun tag Git trovato su questo remote. Uso fallback." + VERSION="2.3.2" + else + VERSION="${LATEST_TAG#v}" fi - echo "Versione calcolata: $VERSION" + echo "Versione calcolata: $VERSION (da tag: $LATEST_TAG)" echo "APP_VERSION=$VERSION" >> "$GITHUB_ENV" shell: bash @@ -119,16 +121,17 @@ jobs: with: fetch-depth: 0 # Necessario per MinVer: deve percorrere tutta la storia Git per trovare i tag - - name: Calcola versione con MinVer + - name: Calcola versione run: | git fetch --tags --force - $VERSION = (cd Data_Coupler; dotnet msbuild -getProperty:Version -p:ContinuousIntegrationBuild=true 2>$null | Select-Object -Last 1) - if ([string]::IsNullOrWhiteSpace($VERSION) -or $VERSION -eq "0.0.0-alpha.0") { - Write-Host "Warning: MinVer non ha trovato tag. Uso fallback." - $commitCount = git rev-list --count HEAD - $VERSION = "2.3.2-alpha.0.$commitCount" + $LATEST_TAG = git describe --tags --abbrev=0 2>$null + if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($LATEST_TAG)) { + Write-Host "Warning: Nessun tag Git trovato su questo remote. Uso fallback." + $VERSION = "2.3.2" + } else { + $VERSION = $LATEST_TAG -replace '^v', '' } - Write-Host "Versione calcolata: $VERSION" + Write-Host "Versione calcolata: $VERSION (da tag: $LATEST_TAG)" "APP_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh -- 2.52.0 From 46fc21bf7b140319cb6c3bf667e84b75d49a671a Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Sun, 22 Mar 2026 16:11:30 +0100 Subject: [PATCH 4/5] [Fix] GitHub Actions: aggiunge generazione version.json prima del Docker build Il workflow GitHub non generava version.json sul runner prima del build, quindi Docker copiava il file statico del repository (con versione vecchia 2.1.0). La Gitea Actions usava gia questo approccio correttamente. Fix applicato: lo step 'Calcola versione' ora genera anche version.json in Data_Coupler/wwwroot/version.json per entrambi i job Linux e Windows, con versione, commit SHA, branch, data build e ambiente (GitHub Actions). Il VersionService legge version.json all'avvio per display nell'UI. --- .github/workflows/docker-build.yml | 39 ++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 4b07830..a3014cc 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -39,7 +39,7 @@ jobs: with: dotnet-version: '9.0.x' - - name: Calcola versione + - name: Calcola versione e genera version.json run: | git fetch --tags --force LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") @@ -50,6 +50,21 @@ jobs: VERSION="${LATEST_TAG#v}" fi echo "Versione calcolata: $VERSION (da tag: $LATEST_TAG)" + + # Genera version.json + cat > Data_Coupler/wwwroot/version.json <> "$GITHUB_ENV" shell: bash @@ -121,7 +136,7 @@ jobs: with: fetch-depth: 0 # Necessario per MinVer: deve percorrere tutta la storia Git per trovare i tag - - name: Calcola versione + - name: Calcola versione e genera version.json run: | git fetch --tags --force $LATEST_TAG = git describe --tags --abbrev=0 2>$null @@ -132,6 +147,26 @@ jobs: $VERSION = $LATEST_TAG -replace '^v', '' } Write-Host "Versione calcolata: $VERSION (da tag: $LATEST_TAG)" + + $COMMIT_SHA = "${{ github.sha }}" + $SHORT_SHA = $COMMIT_SHA.Substring(0, 7) + $BRANCH = "${{ github.ref_name }}" + $BUILD_DATE = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss UTC") + + # Genera version.json + $versionJson = @{ + version = $VERSION + commitSha = $SHORT_SHA + branch = $BRANCH + buildDate = $BUILD_DATE + buildEnvironment = "GitHub Actions" + } | ConvertTo-Json + + $versionJson | Out-File -FilePath "Data_Coupler\wwwroot\version.json" -Encoding UTF8 + + Write-Host "Generated version.json:" + Get-Content "Data_Coupler\wwwroot\version.json" + "APP_VERSION=$VERSION" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh -- 2.52.0 From f1f75d59acc0353d9871e02a51729ebf88347f5e Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Sun, 22 Mar 2026 16:18:14 +0100 Subject: [PATCH 5/5] [Fix] Dockerfile.windows: aggiunge ContinuousIntegrationBuild=true a dotnet build e publish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Senza questo flag il target GenerateVersionJson nel .csproj veniva eseguito dentro il container Docker Windows dove: - Non esiste .git (fatal: not a git repository) - version.json copiato da COPY e' read-only o protetto → MSB3491: Access to the path '...\wwwroot\version.json' is denied Il Dockerfile Linux aveva gia /p:ContinuousIntegrationBuild=true. La condizione nel .csproj e': Condition="'' != 'true' AND '' != 'true'" quindi con il flag il target viene saltato e version.json usa quello generato dal workflow prima del docker build. --- Dockerfile.windows | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.windows b/Dockerfile.windows index 845b62d..8a480d3 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -25,13 +25,13 @@ COPY ["Components/", "Components/"] # Build del progetto principale con output path corto WORKDIR "/s/Data_Coupler" -RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore /p:MinVerVersionOverride=%APP_VERSION% +RUN dotnet build "Data_Coupler.csproj" -c Release -o /o --no-restore /p:ContinuousIntegrationBuild=true /p:MinVerVersionOverride=%APP_VERSION% # Stage 2: Publish FROM build AS publish # Necessario ridichiarare ARG dopo FROM in multi-stage build ARG APP_VERSION=0.0.0-alpha.0 -RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false /p:MinVerVersionOverride=%APP_VERSION% +RUN dotnet publish "Data_Coupler.csproj" -c Release -o /p --no-restore -r win-x64 --self-contained false /p:ContinuousIntegrationBuild=true /p:MinVerVersionOverride=%APP_VERSION% # Stage 3: Runtime FROM mcr.microsoft.com/dotnet/aspnet:9.0-nanoserver-ltsc2022 AS final -- 2.52.0