-
-
Notifications
You must be signed in to change notification settings - Fork 7
50 lines (47 loc) · 1.86 KB
/
Release.yml
File metadata and controls
50 lines (47 loc) · 1.86 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
name: Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.2.0
with:
versionSpec: "6.x"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v4.2.0
with:
useConfigFile: true
- name: Pack
run: dotnet pack source /p:Version=${{ steps.gitversion.outputs.majorMinorPatch }} /p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }} /p:PackageReleaseNotes="https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ steps.gitversion.outputs.majorMinorPatch }}" -o ./releases
- name: Publish
run: dotnet nuget push ./releases/**/*.nupkg -k=${{ secrets.NUGETORGAPIKEY }} -s=nuget.org
- name: Generate CHANGELOG.md
id: releasenotes
run: |
gh api repos/$GITHUB_REPOSITORY/releases/generate-notes \
-f tag_name="${{ steps.gitversion.outputs.majorMinorPatch }}" \
-q .body > CHANGELOG.md
echo -e "\n\n" >> CHANGELOG.md
git log $(git describe --tags --abbrev=0)..HEAD --oneline >> CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
run: |
gh release create "${{ steps.gitversion.outputs.majorMinorPatch }}" \
--repo="$GITHUB_REPOSITORY" \
--title="Release ${{ steps.gitversion.outputs.majorMinorPatch }}" \
--notes-file=CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}