Skip to content

Commit 1fdb08d

Browse files
chore: release workflow (#175)
Co-authored-by: Meir Blachman <meblachm@microsoft.com>
1 parent 9fc7ece commit 1fdb08d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish NuGet package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Setup .NET Core
16+
uses: actions/setup-dotnet@v2
17+
with:
18+
dotnet-version: '6.x'
19+
20+
- name: Restore dependencies
21+
run: dotnet restore
22+
23+
- name: Build & Pack NuGet package
24+
shell: pwsh
25+
run: |
26+
$tag = $env:GITHUB_REF.Substring('refs/tags/v'.Length)
27+
dotnet pack src/FluentAssertions.Analyzers/ --output out --configuration Release --include-symbols -p:Version=$tag
28+
29+
- name: Publish NuGet package
30+
shell: pwsh
31+
run: |
32+
$symbols = Get-ChildItem out/*.symbols.nupkg | ForEach-Object FullName;
33+
foreach ($symbol in $symbols) {
34+
Write-Host "Pushing symbols $symbol";
35+
$nupkg = $symbol.Replace(".symbols.nupkg",".nupkg");
36+
Write-Host "Pushing nupkg $nupkg";
37+
dotnet nuget push $nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json;
38+
}

0 commit comments

Comments
 (0)