-
Notifications
You must be signed in to change notification settings - Fork 17
73 lines (61 loc) · 2.33 KB
/
release.yml
File metadata and controls
73 lines (61 loc) · 2.33 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
name: Create Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-22.04
env:
COREHOST_TRACE: false
DOTNET_CLI_TELEMETRY_OPTOUT: 1 # Disable sending usage data to Microsoft
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 # prevent the caching of the packages on the build machine
DOTNET_NOLOGO: true # removes logo and telemetry message from first run of dotnet cli
NUGET_XMLDOC_MODE: skip # prevent the download of the XML documentation for the packages
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
7.0.x
8.0.x
- name: Setup Nuget Cache
uses: actions/cache@v5
id: nuget-cache
with:
path: ~/.nuget
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Restore Nuget packages
run: dotnet restore -v:n
- name: Prepare Release Assets
id: get-version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
.github/release-notes.sh CHANGELOG.md > release-notes.txt
- name: Creates Nuget package
run: dotnet pack --configuration Release --output ./SignNow.Net/bin/Publish SignNow.Net
- name: Create Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ env.GITHUB_TOKEN }}
name: signNow .Net SDK v${{ steps.get-version.outputs.VERSION }}
tag: ${{ steps.get-version.outputs.VERSION }}
bodyFile: ${{ github.workspace }}/release-notes.txt
allowUpdates: true
artifacts: ${{ github.workspace }}/SignNow.Net/bin/Publish/*.nupkg
artifactContentType: application/octet-stream
- name: Publish Nuget Package
working-directory: ${{ github.workspace }}/SignNow.Net/bin/Publish
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
run: |
dotnet nuget push SignNow.Net.${{ steps.get-version.outputs.VERSION }}.nupkg \
--api-key ${{ env.NUGET_TOKEN }} \
--source https://api.nuget.org/v3/index.json