-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (83 loc) · 2.51 KB
/
release.yml
File metadata and controls
101 lines (83 loc) · 2.51 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
98
99
100
101
name: .NET Continuous Deployment
on:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: SharedCode Test
runs-on: windows-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 9.0.x
- name: Run Tests
run: dotnet test --logger GitHubActions --verbosity normal SharedCode.sln
semantic-release:
needs: test
name: Create a Package Release
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 9.0.x
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Create Nuget Package
run: dotnet build -c Release SharedCode.sln && dotnet pack -c Release -p:PackageVersion=${{ steps.tag_version.outputs.new_version }} -o . SharedCode.sln
- name: Upload Package for Publishing
uses: actions/upload-artifact@v4.6.1
with:
name: PackedLib
path: ./*.nupkg
github-publish:
needs: semantic-release
name: Publish to Github
runs-on: windows-latest
permissions:
packages: write
steps:
- name: Download built project
uses: actions/download-artifact@v4.1.8
with:
name: PackedLib
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 9.0.x
- name: Push Package to GitHub
run: dotnet nuget push --api-key ${{secrets.GITHUB_TOKEN}} --source "https://nuget.pkg.github.com/improvgroup/index.json" *.nupkg
nuget-publish:
needs: semantic-release
name: Publish to Nuget
runs-on: windows-latest
permissions:
packages: write
steps:
- name: Download built project
uses: actions/download-artifact@v4.1.8
with:
name: PackedLib
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 9.0.x
- name: Push Package to NuGet
run: dotnet nuget push --api-key ${{secrets.NUGET_API_KEY}} --source "https://api.nuget.org/v3/index.json" *.nupkg