diff --git a/.github/workflows/template-url.yml b/.github/workflows/template-url.yml index b87e6760..86579767 100644 --- a/.github/workflows/template-url.yml +++ b/.github/workflows/template-url.yml @@ -14,7 +14,7 @@ on: type: string jobs: - + test: name: ${{ inputs.openapi }}.${{ inputs.format }} (${{ inputs.version }}) ${{ inputs.os }} @@ -24,16 +24,20 @@ jobs: steps: - name: 🛒 Checkout repository uses: actions/checkout@v4 + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0' - name: 🛠️ Generate code - run: | + run: | ${{ inputs.command }} "${{ inputs.openapi }}" --namespace "Petstore" --output Output.cs --no-logging ${{ inputs.command }} "${{ inputs.openapi }}" --namespace "Petstore.Interface" --output IOutput.cs --interface-only --no-logging ${{ inputs.command }} "${{ inputs.openapi }}" --namespace "Petstore.UsingApiResponse" --output IApiOutput.cs --interface-only --return-api-response --no-logging - + Copy-Item Output.cs ./ConsoleApp/Net6/ Copy-Item Output.cs ./ConsoleApp/Net7/ Copy-Item Output.cs ./ConsoleApp/Net8/ + Copy-Item Output.cs ./ConsoleApp/Net9/ Copy-Item Output.cs ./ConsoleApp/Net48/ Copy-Item Output.cs ./ConsoleApp/Net472/ Copy-Item Output.cs ./ConsoleApp/Net462/ @@ -58,6 +62,11 @@ jobs: run: dotnet build ./ConsoleApp/Net8/Net8.csproj working-directory: test + - name: 🛠️ Build .NET 9 generated code + run: dotnet build ./ConsoleApp/Net9/Net9.csproj + working-directory: test + if: steps.prepare_openapi_spec.outputs.exists == 'True' + - name: 🛠️ Build .NET 4.8.1 generated code run: dotnet build ./ConsoleApp/Net481/Net481.csproj working-directory: test diff --git a/.github/workflows/template.yml b/.github/workflows/template.yml index 34f81e35..66415297 100644 --- a/.github/workflows/template.yml +++ b/.github/workflows/template.yml @@ -20,7 +20,7 @@ on: type: string jobs: - + test: name: ${{ inputs.openapi }}.${{ inputs.format }} (${{ inputs.version }}) ${{ inputs.os }} @@ -46,7 +46,9 @@ jobs: steps: - name: 🛒 Checkout repository uses: actions/checkout@v4 - + - uses: actions/setup-dotnet@v4 + with: + dotnet-version: '9.0' - name: 🛠️ Prepare OpenAPI Spec id: prepare_openapi_spec run: | @@ -67,6 +69,7 @@ jobs: Copy-Item *.cs ./ConsoleApp/Net6/ Copy-Item *.cs ./ConsoleApp/Net7/ Copy-Item *.cs ./ConsoleApp/Net8/ + Copy-Item *.cs ./ConsoleApp/Net9/ Copy-Item *.cs ./ConsoleApp/Net48/ Copy-Item *.cs ./ConsoleApp/Net472/ Copy-Item *.cs ./ConsoleApp/Net462/ @@ -76,7 +79,7 @@ jobs: working-directory: test shell: pwsh if: steps.prepare_openapi_spec.outputs.exists == 'True' - + - name: 🛠️ Publish generated code as Artifact uses: actions/upload-artifact@v3 with: @@ -99,6 +102,11 @@ jobs: working-directory: test if: steps.prepare_openapi_spec.outputs.exists == 'True' + - name: 🛠️ Build .NET 9 generated code + run: dotnet build ./ConsoleApp/Net9/Net9.csproj + working-directory: test + if: steps.prepare_openapi_spec.outputs.exists == 'True' + - name: 🛠️ Build .NET 4.8.1 generated code run: dotnet build ./ConsoleApp/Net481/Net481.csproj if: ${{ steps.prepare_openapi_spec.outputs.exists == 'True' && inputs.os == 'windows-2022' }}