-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 2.98 KB
/
release.yml
File metadata and controls
97 lines (81 loc) · 2.98 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: Release & Publish
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clean
run: |
dotnet clean Reliable.HttpClient.sln -c Release || true
find src -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} + || true
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Extract version
id: ver
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Pack
run: |
dotnet pack src/Reliable.HttpClient/Reliable.HttpClient.csproj \
-c Release \
-p:ContinuousIntegrationBuild=true \
-p:Version=${{ steps.ver.outputs.version }} \
--no-build
- name: Verify package exists
run: |
compgen -G "src/Reliable.HttpClient/bin/Release/*.nupkg" > /dev/null \
|| (echo "No .nupkg produced" >&2; exit 1)
- name: List packaged artifacts
run: |
echo "Listing packed files:" && ls -la src/Reliable.HttpClient/bin/Release || true
echo "NUPKG:" && ls -1 src/Reliable.HttpClient/bin/Release/*.nupkg || echo "No .nupkg found"
echo "SNUPKG:" && ls -1 src/Reliable.HttpClient/bin/Release/*.snupkg || echo "No .snupkg found"
- name: Archive package
uses: actions/upload-artifact@v4
with:
name: nupkg
path: src/Reliable.HttpClient/bin/Release/*.nupkg
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: src/Reliable.HttpClient/bin/Release/*.nupkg
generate_release_notes: true
- name: Publish to NuGet
run: |
dotnet nuget push src/Reliable.HttpClient/bin/Release/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
- name: Publish symbols to NuGet
run: |
if compgen -G "src/Reliable.HttpClient/bin/Release/*.snupkg" > /dev/null; then
dotnet nuget push src/Reliable.HttpClient/bin/Release/*.snupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
else
echo "No snupkg files found, skipping symbol package push."
fi
- name: Publish to GitHub Packages
run: |
dotnet nuget push src/Reliable.HttpClient/bin/Release/*.nupkg \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/akrisanov/index.json \
--skip-duplicate