-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.55 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (46 loc) · 1.55 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
name: Release
on:
push:
branches:
- 'release/v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore src/Endpointer.slnx
- name: Build
run: dotnet build src/Endpointer.slnx -c Release --no-restore
- name: Read version
id: version
run: |
VERSION=$(jq -r '.Version' src/Endpointer/bin/Release/netstandard2.0/version.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
- name: Test
run: dotnet test --solution src/Endpointer.slnx -c Release --no-build
- name: Pack
run: dotnet pack src/Endpointer/Endpointer.csproj -c Release --no-build -o ./artifacts
- name: NuGet login
id: nuget-login
uses: nuget/login@v1
with:
user: ${{ secrets.NUGET_USER }}
- name: Push to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.version.outputs.tag }}
name: ${{ steps.version.outputs.tag }}
generate_release_notes: true
files: ./artifacts/*.nupkg