forked from xceedsoftware/wpftoolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 2.29 KB
/
publish-nuget.yaml
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
name: publish
on:
push:
branches:
- master
tags:
- "*"
jobs:
build-and-publish-nuget:
name: build and publish nuget
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # get full History to make sure tags are included an thus git-describe works
- name: Get version number
id: version
uses: PaulHatch/[email protected]
- name: Generate semver version number
id: generate-version
shell: powershell
run: |
if("${{ steps.version.outputs.is_tagged }}" -eq "false")
{
$semver_version = "${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}-beta.${{ steps.version.outputs.increment }}"
}
else
{
$semver_version = "${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}"
}
$assembly_version = "${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }}.${{ steps.version.outputs.increment }}"
echo assembly-version=${assembly_version} >> $env:GITHUB_OUTPUT
echo semantic-version=${semver_version} >> $env:GITHUB_OUTPUT
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v3
with:
source-url: https://nuget.pkg.github.com/renewedvision/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Build
id: build
shell: powershell
run: |
dotnet publish ExtendedWPFToolkitSolution/Xceed.Wpf.Toolkit.sln -restore -p:RestorePackagesConfig=true -p:Version="${{ steps.generate-version.outputs.semantic-version }}" -p:AssemblyVersion="${{ steps.generate-version.outputs.assembly-version }}" -t:Rebuild -p:Configuration=Release
- name: Package
id: package
run: |
dotnet pack -Version ${{ steps.generate-version.outputs.semantic-version }}
- name: Publish Nuget to GitHub registry
shell: powershell
run: |
foreach($file in (Get-ChildItem . -Recurse -Include *.nupkg)) {
dotnet nuget push $file --skip-duplicate
}