-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (39 loc) · 1.52 KB
/
publish.yml
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
name: Publish on NuGet
on:
release:
types: [created]
env:
VERSION: ${{ github.event.release.tag_name }}
jobs:
publish-nuget:
runs-on: ubuntu-latest
strategy:
matrix:
package: [ Fluss, Fluss.HotChocolate, Fluss.PostgreSQL, Fluss.Regen, Fluss.Testing ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
9.x
- name: Strip v from tag to determine version
run: echo "VERSION=${VERSION/v/}" >> $GITHUB_ENV
# dotnet pack says it already builds the project but it for some reason does not properly generate
# the analyzers directory when skipping an explicit build. It's unclear to me what the difference is.
- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION}
working-directory: src/${{ matrix.package }}
- name: Package
run: dotnet pack --no-build --configuration Release /p:Version=${VERSION}
working-directory: src/${{ matrix.package }}
- name: DEBUG - Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}.nupkg
path: src/${{ matrix.package }}/bin/Release
retention-days: 1
- name: Publish
run: dotnet nuget push bin/Release/${{ matrix.package }}.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
working-directory: src/${{ matrix.package }}