-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (62 loc) · 1.87 KB
/
build-release-publish.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build-Release-Publish
on:
push:
branches:
- master
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
NUGET_XMLDOC_MODE: skip
WORKFLOW_VERSION_PROJ: Directory.Build.props
WORKFLOW_BUILD_SLN: SourceExpander.sln
jobs:
get-version:
uses: kzrnm/dotnet-actions/.github/workflows/get-version.yml@v2
with:
project-path: Directory.Build.props
format:
uses: kzrnm/dotnet-actions/.github/workflows/format.yml@v2
with:
target: SourceExpander.sln
dotnet-version: |
8.0.x
6.0.x
build:
runs-on: windows-latest
needs: [get-version]
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
6.0.x
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/Directory.Build.props') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build ${{ env.WORKFLOW_BUILD_SLN }} -c Release
- name: Test
run: dotnet test ${{ env.WORKFLOW_BUILD_SLN }} --no-build --logger GitHubActions -c Release
- uses: actions/upload-artifact@v4
if: ${{ needs.get-version.outputs.is-new == 'true' }}
with:
name: dist
path: bin/Packages/Release
publish:
needs: [get-version, build, format]
if: ${{ needs.get-version.outputs.is-new == 'true' }}
uses: kzrnm/dotnet-actions/.github/workflows/publish.yml@v2
with:
artifact-name: dist
version: ${{ needs.get-version.outputs.version }}
is-prerelease: ${{ needs.get-version.outputs.is-prerelease == 'true' }}
secrets:
NUGET_KEY: ${{ secrets.NUGET_KEY }}