diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 937955d..46de64d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,8 +54,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v5 - with: - token: ${{ secrets.PAT_FOR_TAGGING }} - name: Configure Git run: >- git config user.name "GitHub Action" @@ -117,7 +115,9 @@ jobs: ${{ steps.extract_package_release_notes.outputs.package_release_notes }} env: - GITHUB_TOKEN: ${{ secrets.PAT_FOR_TAGGING }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write publish: name: Publish to NuGet runs-on: ubuntu-latest @@ -137,5 +137,13 @@ jobs: run: dotnet build --no-restore --configuration Release - name: Pack NuGet Package run: dotnet pack --configuration Release --include-symbols + - name: NuGet Login + id: nuget_login + uses: NuGet/login@v1 + with: + user: ${{ secrets.NUGET_USER }} - name: Push NuGet Package - run: dotnet nuget push **/bin/Release/**/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ACCESS }} --skip-duplicate + run: dotnet nuget push **/bin/Release/**/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ steps.nuget_login.outputs.NUGET_API_KEY }} --skip-duplicate + permissions: + id-token: write + contents: read diff --git a/NEL.MESH.Infrastructure/NEL.MESH.Infrastructure.csproj b/NEL.MESH.Infrastructure/NEL.MESH.Infrastructure.csproj index 22f9393..be22e28 100644 --- a/NEL.MESH.Infrastructure/NEL.MESH.Infrastructure.csproj +++ b/NEL.MESH.Infrastructure/NEL.MESH.Infrastructure.csproj @@ -10,7 +10,7 @@ - + diff --git a/NEL.MESH.Infrastructure/Services/ScriptGenerationService.cs b/NEL.MESH.Infrastructure/Services/ScriptGenerationService.cs index 236a1e3..cf3988c 100644 --- a/NEL.MESH.Infrastructure/Services/ScriptGenerationService.cs +++ b/NEL.MESH.Infrastructure/Services/ScriptGenerationService.cs @@ -99,11 +99,10 @@ public void GenerateBuildScript(string branchName, string projectName, string do }, { "add_tag", - new TagJobV2( + new TagJobV3( runsOn: BuildMachines.UbuntuLatest, dependsOn: "build", projectRelativePath: $"{projectName}/{projectName}.csproj", - githubToken: "${{ secrets.PAT_FOR_TAGGING }}", branchName: branchName) { Name = "Add Tag and Create Release" @@ -111,11 +110,11 @@ public void GenerateBuildScript(string branchName, string projectName, string do }, { "publish", - new PublishJobV4( + new NugetTrustedPublishingJob( runsOn: BuildMachines.UbuntuLatest, dependsOn: "add_tag", dotNetVersion: dotNetVersion, - nugetApiKey: "${{ secrets.NUGET_ACCESS }}") + nugetUser: "${{ secrets.NUGET_USER }}") { Name = "Publish to NuGet" } diff --git a/NEL.MESH.Tests.Acceptance/NEL.MESH.Tests.Acceptance.csproj b/NEL.MESH.Tests.Acceptance/NEL.MESH.Tests.Acceptance.csproj index d9f4c3c..9e85107 100644 --- a/NEL.MESH.Tests.Acceptance/NEL.MESH.Tests.Acceptance.csproj +++ b/NEL.MESH.Tests.Acceptance/NEL.MESH.Tests.Acceptance.csproj @@ -12,12 +12,12 @@ - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -27,7 +27,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/NEL.MESH.Tests.Integration.Witness/NEL.MESH.Tests.Integration.Witness.csproj b/NEL.MESH.Tests.Integration.Witness/NEL.MESH.Tests.Integration.Witness.csproj index 456817a..f0f9b13 100644 --- a/NEL.MESH.Tests.Integration.Witness/NEL.MESH.Tests.Integration.Witness.csproj +++ b/NEL.MESH.Tests.Integration.Witness/NEL.MESH.Tests.Integration.Witness.csproj @@ -16,8 +16,8 @@ - - + + @@ -30,7 +30,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/NEL.MESH.Tests.Integration/NEL.MESH.Tests.Integration.csproj b/NEL.MESH.Tests.Integration/NEL.MESH.Tests.Integration.csproj index 431d0aa..85ba952 100644 --- a/NEL.MESH.Tests.Integration/NEL.MESH.Tests.Integration.csproj +++ b/NEL.MESH.Tests.Integration/NEL.MESH.Tests.Integration.csproj @@ -16,8 +16,8 @@ - - + + @@ -30,7 +30,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/NEL.MESH.Tests.Unit/NEL.MESH.Tests.Unit.csproj b/NEL.MESH.Tests.Unit/NEL.MESH.Tests.Unit.csproj index 1d50b16..1012ed2 100644 --- a/NEL.MESH.Tests.Unit/NEL.MESH.Tests.Unit.csproj +++ b/NEL.MESH.Tests.Unit/NEL.MESH.Tests.Unit.csproj @@ -12,8 +12,8 @@ - - + + @@ -26,7 +26,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/NEL.MESH.UI/NEL.MESH.UI.csproj b/NEL.MESH.UI/NEL.MESH.UI.csproj index 395ea26..e0f8612 100644 --- a/NEL.MESH.UI/NEL.MESH.UI.csproj +++ b/NEL.MESH.UI/NEL.MESH.UI.csproj @@ -11,10 +11,10 @@ - - - - + + + + diff --git a/NEL.MESH/NEL.MESH.csproj b/NEL.MESH/NEL.MESH.csproj index a536c9b..bb0f1ba 100644 --- a/NEL.MESH/NEL.MESH.csproj +++ b/NEL.MESH/NEL.MESH.csproj @@ -51,8 +51,8 @@ - - + +