-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (53 loc) · 1.76 KB
/
release.yml
File metadata and controls
68 lines (53 loc) · 1.76 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 to NuGet
on:
push:
tags: ['v*']
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
publish:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Pack global tool
run: dotnet pack AiCodeGraph.Cli --configuration Release -p:Version=${{ steps.version.outputs.VERSION }}
- name: Verify tool installs
run: |
dotnet tool install --global --add-source AiCodeGraph.Cli/nupkg AiCodeGraph.Cli
ai-code-graph --help
- name: Push to NuGet.org
run: |
dotnet nuget push AiCodeGraph.Cli/nupkg/AiCodeGraph.Cli.*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: AiCodeGraph.Cli/nupkg/AiCodeGraph.Cli.*.nupkg