-
-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (73 loc) · 2.41 KB
/
release.yml
File metadata and controls
91 lines (73 loc) · 2.41 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
name: Release
on:
release:
types:
- published
env:
DOTNET_NOLOGO: true
CONFIGURATION: Release
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Get version from tag
id: tag_name
run: echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Check out repository
uses: actions/checkout@v5.0.0
- name: Set up .NET
uses: xt0rted/setup-dotnet@v1.5.0
with:
source-url: https://nuget.pkg.github.com/xt0rted/index.json
nuget_auth_token: ${{ secrets.GITHUB_TOKEN }}
- name: Get changelog entry
uses: mindsers/changelog-reader-action@v2.2.3
id: changelog_reader
with:
version: ${{ steps.tag_name.outputs.current_version }}
- run: dotnet tool restore
- run: dotnet r build
- run: dotnet r test -- --no-build --logger GitHubActions
- run: dotnet r pack -- --no-build
- name: Upload artifacts
uses: actions/upload-artifact@v4.6.2
with:
name: nupkg
path: ./artifacts/*.nupkg
- name: Upload release assets
uses: softprops/action-gh-release@v2
id: release_updater
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.changelog_reader.outputs.changes }}
files: ./artifacts/*.nupkg
- name: Create discussion for release
run: |
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/releases/${{ steps.release_updater.outputs.id }} \
-f discussion_category_name='Announcements'
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Publish to GPR
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Publish to nuget.org
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ secrets.NUGET_TOKEN }} \
--source https://api.nuget.org/v3/index.json
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4.6.2
with:
name: verify-test-results
path: |
**/*.received.*