Skip to content

Commit 80c79be

Browse files
authored
chore(ci): revert to enable trusted publishing workflow (#203)
Revert "chore(ci) : revert to previous publish workflow (#167)" This reverts commit ec839b9.
1 parent 01f588a commit 80c79be

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/main.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,26 @@ jobs:
261261
name: nuget-package
262262
path: ./dist
263263

264-
- name: Publish
265-
run: |
266-
echo "Publishing primary package (.nupkg)...";
267-
dotnet nuget push dist/OpenFga.Sdk.*.nupkg --api-key ${NUGET_AUTH_TOKEN} --skip-duplicate --source https://api.nuget.org/v3/index.json
268-
echo "Publishing symbol package (.snupkg)...";
269-
dotnet nuget push dist/OpenFga.Sdk.*.snupkg --api-key ${NUGET_AUTH_TOKEN} --skip-duplicate --source https://api.nuget.org/v3/index.json || echo "No symbol package found or already published."
270-
env:
271-
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}}
264+
- name: NuGet login (OIDC)
265+
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0
266+
id: login
267+
with:
268+
user: ${{ secrets.NUGET_USER }}
272269

270+
- name: Publish to NuGet
271+
run: |
272+
echo "Publishing primary package to NuGet (.nupkg)...";
273+
dotnet nuget push dist/OpenFga.Sdk.*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json
274+
echo "Publishing symbol package to NuGet (.snupkg)...";
275+
dotnet nuget push dist/OpenFga.Sdk.*.snupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --skip-duplicate --source https://api.nuget.org/v3/index.json || echo "No symbol package found or already published."
273276
277+
- name: Publish to GitHub Package Registry
278+
continue-on-error: true
279+
run: |
280+
echo "Publishing primary package to GitHub Package Registry (.nupkg)...";
281+
dotnet nuget push dist/OpenFga.Sdk.*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --source https://nuget.pkg.github.com/openfga/index.json
282+
echo "Publishing symbol package to GitHub Package Registry (.snupkg)...";
283+
dotnet nuget push dist/OpenFga.Sdk.*.snupkg --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --source https://nuget.pkg.github.com/openfga/index.json || echo "No symbol package found or already published."
274284
275285
undraft-release:
276286
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-test')

0 commit comments

Comments
 (0)