Skip to content

Merge pull request #243 from fsprojects/fix-propagating-errorlevel-gh… #99

Merge pull request #243 from fsprojects/fix-propagating-errorlevel-gh…

Merge pull request #243 from fsprojects/fix-propagating-errorlevel-gh… #99

Workflow file for this run

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 and #243
# very important, since we use cmd scripts, the default is psh, and a bug prevents errorlevel to bubble
shell: cmd
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