-
Notifications
You must be signed in to change notification settings - Fork 9
49 lines (49 loc) · 1.65 KB
/
release.yml
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
# This file is auto-generated.
name: Release
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
schedule:
- cron: 0 0 * * 6
workflow_dispatch:
jobs:
nuget:
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- id: version
name: Get version
shell: pwsh
run: echo "version=$(scripts/Get-Version.ps1 -RefName $env:GITHUB_REF)" >> $env:GITHUB_OUTPUT
- run: dotnet pack --configuration Release -p:Version=${{ steps.version.outputs.version }}
- name: Read changelog
uses: ForNeVeR/ChangelogAutomation.action@v2
with:
output: ./release-notes.md
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: |-
./release-notes.md
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.snupkg
- if: startsWith(github.ref, 'refs/tags/v')
name: Create a release
uses: softprops/action-gh-release@v2
with:
body_path: ./release-notes.md
files: |-
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg
./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.snupkg
name: TruePath v${{ steps.version.outputs.version }}
- if: startsWith(github.ref, 'refs/tags/v')
name: Push artifact to NuGet
run: dotnet nuget push ./TruePath/bin/Release/TruePath.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}