Skip to content

Commit 9ff4f89

Browse files
committed
Fix NuGet publish workflow
1 parent dd8701d commit 9ff4f89

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

.github/workflows/config.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,24 @@ jobs:
187187
publish:
188188
runs-on: windows-latest
189189
needs: [test-ubuntu, test-windows]
190-
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
190+
if: startsWith(github.ref, 'refs/tags/')
191+
permissions:
192+
contents: read
193+
id-token: write
191194
steps:
195+
- uses: actions/checkout@v4
196+
197+
- name: Install .NET
198+
uses: actions/setup-dotnet@v4
199+
with:
200+
dotnet-version: ${{ env.DOTNET_VERSION }}
201+
202+
- name: Build
203+
run: dotnet build .\src\EFCore.SingleStore\EFCore.SingleStore.csproj -c Release
204+
205+
- name: Pack NuGet
206+
run: dotnet pack .\src\EFCore.SingleStore\EFCore.SingleStore.csproj -c Release -o efcore_provider
207+
192208
- name: NuGet login (OIDC → temp API key)
193209
uses: NuGet/login@v1
194210
id: login
@@ -207,3 +223,14 @@ jobs:
207223
208224
echo "NuGet Trusted Publishing login succeeded."
209225
echo "Temporary API key was returned, but it was not printed."
226+
227+
- name: Publish NuGet package
228+
env:
229+
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
230+
run: dotnet nuget push .\efcore_provider\*.nupkg --api-key "$env:NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
231+
232+
- name: Upload Artifact
233+
uses: actions/upload-artifact@v4
234+
with:
235+
name: efcore-provider
236+
path: efcore_provider/

0 commit comments

Comments
 (0)