-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.55 KB
/
publish.yml
File metadata and controls
56 lines (47 loc) · 1.55 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
name: Publish NuGet Packages
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
source-url: https://nuget.pkg.github.com/aaroncorberts/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version from tag
id: version
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> "$GITHUB_OUTPUT"
- name: Restore
run: dotnet restore gokstad.sln
- name: Build
env:
PKG_VERSION: ${{ steps.version.outputs.VERSION }}
run: dotnet build gokstad.sln --no-restore --configuration Release -p:Version="$PKG_VERSION"
- name: Pack
env:
PKG_VERSION: ${{ steps.version.outputs.VERSION }}
run: |
for proj in src/Configuration src/Data src/DirectoryServices src/Security src/Tracing src/Web; do
dotnet pack "$proj"/*.csproj --no-build --configuration Release \
-p:Version="$PKG_VERSION" --output ./nupkgs
done
- name: Push to GitHub Packages
run: |
dotnet nuget push ./nupkgs/*.nupkg \
--source "https://nuget.pkg.github.com/aaroncorberts/index.json" \
--api-key "$NUGET_AUTH_TOKEN" \
--skip-duplicate
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}