diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index dcecbf0..f245b4c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -57,8 +57,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"
@@ -120,7 +118,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:
runs-on: ubuntu-latest
needs:
@@ -139,5 +139,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/NHSISL.LibPostalClient.Infrastructure/NHSISL.LibPostalClient.Infrastructure.csproj b/NHSISL.LibPostalClient.Infrastructure/NHSISL.LibPostalClient.Infrastructure.csproj
index e605584..f556a35 100644
--- a/NHSISL.LibPostalClient.Infrastructure/NHSISL.LibPostalClient.Infrastructure.csproj
+++ b/NHSISL.LibPostalClient.Infrastructure/NHSISL.LibPostalClient.Infrastructure.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/NHSISL.LibPostalClient.Infrastructure/Services/ScriptGenerationService.cs b/NHSISL.LibPostalClient.Infrastructure/Services/ScriptGenerationService.cs
index e9d3035..fd20f76 100644
--- a/NHSISL.LibPostalClient.Infrastructure/Services/ScriptGenerationService.cs
+++ b/NHSISL.LibPostalClient.Infrastructure/Services/ScriptGenerationService.cs
@@ -86,19 +86,18 @@ public void GenerateBuildScript()
},
{
"add_tag",
- new TagJobV2(
+ new TagJobV3(
runsOn: BuildMachines.UbuntuLatest,
dependsOn: "build",
projectRelativePath: "NHSISL.LibPostalClient/NHSISL.LibPostalClient.csproj",
- githubToken: "${{ secrets.PAT_FOR_TAGGING }}",
branchName: branchName)
},
{
"publish",
- new PublishJobV4(
+ new NugetTrustedPublishingJob(
runsOn: BuildMachines.UbuntuLatest,
dependsOn: "add_tag",
- nugetApiKey: "${{ secrets.NUGET_ACCESS }}",
+ nugetUser: "${{ secrets.NUGET_USER }}",
dotNetVersion: "10.0.100")
}
}
diff --git a/NHSISL.LibPostalClient.Tests.Acceptance/NHSISL.LibPostalClient.Tests.Acceptance.csproj b/NHSISL.LibPostalClient.Tests.Acceptance/NHSISL.LibPostalClient.Tests.Acceptance.csproj
index 4fd7ac8..a5df415 100644
--- a/NHSISL.LibPostalClient.Tests.Acceptance/NHSISL.LibPostalClient.Tests.Acceptance.csproj
+++ b/NHSISL.LibPostalClient.Tests.Acceptance/NHSISL.LibPostalClient.Tests.Acceptance.csproj
@@ -17,11 +17,11 @@
-
+
-
-
+
+
@@ -33,7 +33,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/NHSISL.LibPostalClient.Tests.Unit/NHSISL.LibPostalClient.Tests.Unit.csproj b/NHSISL.LibPostalClient.Tests.Unit/NHSISL.LibPostalClient.Tests.Unit.csproj
index 340f5c3..089300f 100644
--- a/NHSISL.LibPostalClient.Tests.Unit/NHSISL.LibPostalClient.Tests.Unit.csproj
+++ b/NHSISL.LibPostalClient.Tests.Unit/NHSISL.LibPostalClient.Tests.Unit.csproj
@@ -13,10 +13,10 @@
-
+
-
-
+
+
@@ -28,7 +28,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/NHSISL.LibPostalClient/NHSISL.LibPostalClient.csproj b/NHSISL.LibPostalClient/NHSISL.LibPostalClient.csproj
index 68f1cf7..9d7ece1 100644
--- a/NHSISL.LibPostalClient/NHSISL.LibPostalClient.csproj
+++ b/NHSISL.LibPostalClient/NHSISL.LibPostalClient.csproj
@@ -99,9 +99,9 @@
-
-
-
+
+
+