Skip to content

Commit 856434e

Browse files
committed
fix: extract NuGet version from git tag, switch to API key auth
1 parent f170dc5 commit 856434e

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

.github/workflows/publish.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ on:
44
release:
55
types: [published]
66

7-
permissions:
8-
id-token: write
9-
contents: read
10-
117
jobs:
128
publish:
139
runs-on: ubuntu-latest
1410

1511
steps:
1612
- uses: actions/checkout@v6
1713

14+
- name: Extract version from tag
15+
id: version
16+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
17+
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v5
2020
with:
@@ -24,16 +24,10 @@ jobs:
2424
run: dotnet restore --locked-mode
2525

2626
- name: Build
27-
run: dotnet build src/XperienceCommunity.ProjectSettings/XperienceCommunity.ProjectSettings.csproj --configuration Release --no-restore
27+
run: dotnet build src/XperienceCommunity.ProjectSettings/XperienceCommunity.ProjectSettings.csproj --configuration Release --no-restore /p:Version=${{ steps.version.outputs.VERSION }}
2828

2929
- name: Pack
30-
run: dotnet pack src/XperienceCommunity.ProjectSettings/XperienceCommunity.ProjectSettings.csproj --configuration Release --no-build --output nupkg
31-
32-
- name: NuGet login (OIDC)
33-
uses: NuGet/login@v1
34-
id: nuget_login
35-
with:
36-
user: roeldeb
30+
run: dotnet pack src/XperienceCommunity.ProjectSettings/XperienceCommunity.ProjectSettings.csproj --configuration Release --no-build --output nupkg /p:Version=${{ steps.version.outputs.VERSION }}
3731

38-
- name: Publish to NuGet using Trusted Publishing
39-
run: dotnet nuget push nupkg/*.nupkg --api-key "${{ steps.nuget_login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
32+
- name: Publish to NuGet
33+
run: dotnet nuget push nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<Copyright>Copyright © $(Company) $([System.DateTime]::Now.Year)</Copyright>
77
<Trademark>$(Company)™</Trademark>
88
<VersionPrefix>1.0.0</VersionPrefix>
9-
<VersionSuffix>prerelease-1</VersionSuffix>
109
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1110
<Title>Xperience By Kentico Project Settings</Title>
1211
<Description>Xperience by Kentico ProjectSettings package. Supports global and channel-specific settings with automatic fallback, managed through the Kentico admin interface.</Description>

0 commit comments

Comments
 (0)