-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 2.54 KB
/
release.yml
File metadata and controls
68 lines (55 loc) · 2.54 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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