Skip to content

Commit bfd919b

Browse files
committed
set up trusted publishing
1 parent 0fccf7b commit bfd919b

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/publish.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
#contents: write # for peaceiris/actions-gh-pages
10+
id-token: write # for NuGet trusted publishing
11+
812
jobs:
913
publish:
1014
name: Publish nuget (if new version)
@@ -24,13 +28,11 @@ jobs:
2428
# very important, since we use cmd scripts, the default is psh, and a bug prevents errorlevel to bubble
2529
shell: cmd
2630
run: ./build.cmd
27-
- name: Nuget publish
28-
# skip-duplicate ensures that the 409 error received when the package was already published,
29-
# will just issue a warning and won't have the GH action fail.
30-
# NUGET_PUBLISH_TOKEN_TASKSEQ is valid until approx. 11 Dec 2024 and will need to be updated by then:
31-
# - log in to Nuget.org using 'abelbraaksma' admin account and then refresh the token in Nuget
32-
# - copy the token
33-
# - go to https://github.com/fsprojects/FSharp.Control.TaskSeq/settings/secrets/actions
34-
# - select button "Add repository secret" or update the existing one under "Repository secrets"
35-
# - rerun the job
36-
run: dotnet nuget push packages\FSharp.Control.TaskSeq.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_PUBLISH_TOKEN_TASKSEQ }} --skip-duplicate
31+
- name: Obtain NuGet key
32+
# this hash is v1.1.0
33+
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544
34+
id: login
35+
with:
36+
user: dsyme
37+
- name: Publish NuGets (if this version not published before)
38+
run: dotnet nuget push packages\FSharp.Control.TaskSeq.*.nupkg -s https://www.nuget.org/api/v2/package -k ${{ steps.login.outputs.NUGET_API_KEY }} --skip-duplicate

0 commit comments

Comments
 (0)