-
Notifications
You must be signed in to change notification settings - Fork 8
35 lines (33 loc) · 1.48 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Pack & Publish Nuget
on:
push:
branches:
- main
jobs:
publish:
name: Publish nuget (if new version)
runs-on: windows-latest
steps:
# checkout the code
- name: checkout-code
uses: actions/checkout@v4
with:
fetch-depth: 0
# setup dotnet based on global.json
- name: setup-dotnet
uses: actions/setup-dotnet@v4
# build it, test it, pack it, publish it
- name: Run dotnet build (release, for nuget)
# see issue #105
# very important, since we use cmd scripts, the default is psh, and a bug prevents errorlevel to bubble
run: ./build.cmd
- name: Nuget publish
# skip-duplicate ensures that the 409 error received when the package was already published,
# will just issue a warning and won't have the GH action fail.
# NUGET_PUBLISH_TOKEN_TASKSEQ is valid until approx. 11 Dec 2024 and will need to be updated by then:
# - log in to Nuget.org using 'abelbraaksma' admin account and then refresh the token in Nuget
# - copy the token
# - go to https://github.com/fsprojects/FSharp.Control.TaskSeq/settings/secrets/actions
# - select button "Add repository secret" or update the existing one under "Repository secrets"
# - rerun the job
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