-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 3.37 KB
/
Copy pathrelease-nuget.yml
File metadata and controls
97 lines (81 loc) · 3.37 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build & Publish NuGet
on:
push:
branches:
- release # run when pushing to the release branch
workflow_dispatch: # optional manual trigger
jobs:
build-pack-push:
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'
# Read base version from central config file and build full version
- name: Determine version
id: version
run: |
BASE_VERSION=$(cat VERSION.txt)
echo "Base version: $BASE_VERSION"
FULL_VERSION="$BASE_VERSION.${GITHUB_RUN_NUMBER}"
echo "Full version: $FULL_VERSION"
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_OUTPUT
echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_OUTPUT
# Restore & build solution
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
# Run ALL test projects
- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal
# Pack all relevant projects into ./artifacts with unified version
- name: Pack FluentAAS Builder
run: dotnet pack src/FluentAas.Builder/FluentAas.Builder.csproj \
-c Release -o ./artifacts \
/p:PackageVersion=${{ steps.version.outputs.FULL_VERSION }}
- name: Pack FluentAAS Core
run: dotnet pack src/FluentAas.Core/FluentAas.Core.csproj \
-c Release -o ./artifacts \
/p:PackageVersion=${{ steps.version.outputs.FULL_VERSION }}
- name: Pack FluentAAS IO
run: dotnet pack src/FluentAas.IO/FluentAas.IO.csproj \
-c Release -o ./artifacts \
/p:PackageVersion=${{ steps.version.outputs.FULL_VERSION }}
- name: Pack FluentAAS Templates
run: dotnet pack src/FluentAas.Templates/FluentAas.Templates.csproj \
-c Release -o ./artifacts \
/p:PackageVersion=${{ steps.version.outputs.FULL_VERSION }}
# Publish NuGet packages to nuget.org
- name: Publish to NuGet
run: dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
# Build changelog / release notes automatically using release-changelog-builder
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
fetchReleaseInformation: "true"
failOnError: "true"
# Upload artifacts to the workflow run (extra manual download option)
- name: Upload NuGet Artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages-${{ steps.version.outputs.FULL_VERSION }}
path: ./artifacts/*.nupkg
# Create GitHub Release with generated changelog and attach .nupkg files
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.FULL_VERSION }}
name: FluentAAS v${{ steps.version.outputs.FULL_VERSION }}
body: ${{ steps.build_changelog.outputs.changelog }}
files: ./artifacts/*.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}