-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (93 loc) · 2.71 KB
/
Copy pathrelease.yml
File metadata and controls
112 lines (93 loc) · 2.71 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
102
103
104
105
106
107
108
109
110
111
112
name: .NET Continuous Deployment
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: SharedCode Test
runs-on: windows-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Run Tests
run: dotnet test SharedCode.sln --verbosity normal
semantic-release:
needs: test
name: Create a Package Release
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.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@v7
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@v8
with:
name: PackedLib
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.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:
contents: read
id-token: write
steps:
- name: Download built project
uses: actions/download-artifact@v8
with:
name: PackedLib
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
- name: Authenticate with NuGet.org
id: login
uses: NuGet/login@v1
with:
user: ${{ secrets.NUGET_USER }}
- name: Push Package to NuGet
run: dotnet nuget push --api-key ${{ steps.login.outputs.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json" *.nupkg