From b26d23149e72cfd289953ab09fd9890240d875c2 Mon Sep 17 00:00:00 2001 From: Kevin Bost Date: Sun, 7 Jun 2026 18:42:58 -0700 Subject: [PATCH] Enable backend AOT and OpenAPI freshness checks Configure Native AOT for Release builds in the backend project and disable OpenAPI document generation during AOT publish to avoid publish-time failures. Add a CI guard step that regenerates the backend OpenAPI document in non-AOT mode and fails if the checked-in JSON is out of date. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build-and-deploy.yml | 12 ++++++++++++ src/AzraTasks.Api/AzraTasks.Api.csproj | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 51c6e0c..bcf5a0d 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -71,6 +71,18 @@ jobs: - name: Build run: dotnet build --no-restore --configuration Release + - name: Verify OpenAPI document is up to date + run: | + dotnet build .\src\AzraTasks.Api\AzraTasks.Api.csproj ` + --configuration Release ` + --no-restore ` + -p:PublishAot=false ` + -p:OpenApiGenerateDocuments=true ` + -p:OpenApiGenerateDocumentsOnBuild=true + + git update-index --refresh + git --no-pager diff --exit-code -- .\src\AzraTasks.Api\AzraTasks.Api.json + - name: Restore dotnet tool run: dotnet tool restore diff --git a/src/AzraTasks.Api/AzraTasks.Api.csproj b/src/AzraTasks.Api/AzraTasks.Api.csproj index 0340b9c..eac6bab 100644 --- a/src/AzraTasks.Api/AzraTasks.Api.csproj +++ b/src/AzraTasks.Api/AzraTasks.Api.csproj @@ -12,6 +12,14 @@ . + + true + true + Speed + false + false + +