Skip to content

Commit 305f953

Browse files
Update the GitHub Actions script
- Fix the .NET version - Add NuGet Trusted Publishing - Update action versions
1 parent abc2e5d commit 305f953

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
runs-on: windows-latest
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919

2020
- name: Setup .NET
21-
uses: actions/setup-dotnet@v4
21+
uses: actions/setup-dotnet@v5
2222
with:
23-
dotnet-version: 9.0.x
23+
dotnet-version: 10.0.x
2424

2525
- name: Setup docfx
2626
shell: pwsh
@@ -30,7 +30,7 @@ jobs:
3030
- name: Test Matchmaker
3131
shell: pwsh
3232
run: |
33-
dotnet test Matchmaker.slnx --nologo -c Release /p:ContinuousIntegrationBuild=true
33+
dotnet test Matchmaker.slnx -c Release /p:ContinuousIntegrationBuild=true
3434
3535
- name: Pack Matchmaker
3636
shell: pwsh
@@ -39,7 +39,7 @@ jobs:
3939
dotnet pack --nologo -c Release -o ${{github.workspace}}\build\ /p:ContinuousIntegrationBuild=true
4040
4141
- name: Upload Matchmaker
42-
uses: actions/upload-artifact@v4
42+
uses: actions/upload-artifact@v5
4343
with:
4444
name: matchmaker-build
4545
path: ${{github.workspace}}\build\*
@@ -63,25 +63,37 @@ jobs:
6363
publish:
6464
runs-on: windows-latest
6565
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
66-
needs: [build]
66+
needs:
67+
- build
68+
69+
permissions:
70+
id-token: write
6771

6872
steps:
6973
- name: Checkout
70-
uses: actions/checkout@v4
74+
uses: actions/checkout@v5
7175

7276
- name: Setup .NET
73-
uses: actions/setup-dotnet@v4
77+
uses: actions/setup-dotnet@v5
7478
with:
75-
dotnet-version: 9.0.x
79+
dotnet-version: 10.0.x
7680

7781
- name: Fetch Package
78-
uses: actions/download-artifact@v4
82+
uses: actions/download-artifact@v6
7983
with:
8084
name: matchmaker-build
8185
path: matchmaker-build
86+
87+
- name: NuGet Login
88+
uses: NuGet/login@v1
89+
id: login
90+
with:
91+
user: ${{ secrets.NUGET_USER }}
8292

8393
- name: Publish Package
8494
shell: pwsh
8595
run: |
8696
cd .\matchmaker-build
87-
dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
97+
dotnet nuget push "*.nupkg" `
98+
--api-key ${{ steps.login.outputs.NUGET_API_KEY }} `
99+
--source https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)