Skip to content

Merge pull request #33 from leeoades/copilot/update-change-log-and-docs #19

Merge pull request #33 from leeoades/copilot/update-change-log-and-docs

Merge pull request #33 from leeoades/copilot/update-change-log-and-docs #19

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
id-token: write # Required for OIDC authentication to NuGet.org
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: "9.0.x"
- name: Restore
run: dotnet restore FunctionalStateMachine.sln
- name: Build
run: dotnet build FunctionalStateMachine.sln --configuration Release --no-restore
- name: Test
run: dotnet test FunctionalStateMachine.sln --configuration Release --no-build --verbosity normal
- name: Set Version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Extract Release Notes
run: |
pwsh scripts/extract-changelog.ps1 -Version ${VERSION} > release-notes.txt
echo "Release notes extracted:"
cat release-notes.txt
- name: Pack
run: |
RELEASE_NOTES="See https://github.com/leeoades/FunctionalStateMachine/releases/tag/v${VERSION} for full release notes"
dotnet pack src/FunctionalStateMachine.Core/FunctionalStateMachine.Core.csproj --configuration Release --no-build --output ./artifacts --include-symbols --include-source /p:PackageVersion=${VERSION} /p:PackageReleaseNotes="$RELEASE_NOTES"
dotnet pack src/FunctionalStateMachine.CommandRunner/FunctionalStateMachine.CommandRunner.csproj --configuration Release --no-build --output ./artifacts --include-symbols --include-source /p:PackageVersion=${VERSION} /p:PackageReleaseNotes="$RELEASE_NOTES"
dotnet pack src/FunctionalStateMachine.Diagrams/FunctionalStateMachine.Diagrams.csproj --configuration Release --no-build --output ./artifacts /p:PackageVersion=${VERSION} /p:IncludeSymbols=false /p:PackageReleaseNotes="$RELEASE_NOTES"
- name: NuGet login (Trusted Publishing)
uses: NuGet/login@v1
id: nuget-login
with:
user: ${{ secrets.NUGET_USERNAME }} # Your NuGet.org username (not email)
- name: Push to NuGet.org
run: |
dotnet nuget push ./artifacts/*.nupkg \
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
./artifacts/*.nupkg
./artifacts/*.snupkg
generate_release_notes: true