-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.56 KB
/
build.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
name: Build
on:
push:
branches:
- main
paths-ignore:
- example/**
- tests/**
- LICENSE.md
- README.md
pull_request:
branches:
- main
paths-ignore:
- example/**
- tests/**
- LICENSE.md
- README.md
jobs:
build:
name: Build
runs-on: windows-2022
env:
CREATE_RELEASE: ${{ github.ref_name == 'main' && !contains(github.event.head_commit.message, 'dependabot[bot]') }}
CREATE_PRERELEASE: ${{ github.ref_name != 'main') }}
steps:
- name: checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/[email protected]
name: Install .NET 8
with:
dotnet-version: '8.0.x'
dotnet-quality: 'ga'
- name: Restore .NET tools
run: dotnet tool restore
- name: Build
run: |
dotnet cake build.cake --bootstrap
dotnet cake build.cake --pack
- name: Upload NuGet Package
uses: actions/[email protected]
with:
name: package
path: .\artifacts\packages
- name: Push NuGet package on main branch
if: ${{ env.CREATE_RELEASE == 'true' }}
run: dotnet nuget push .\artifacts\packages\ --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ACTIONS }}
- name: Push NuGet package on feature branch
if: ${{ env.CREATE_PRERELEASE == 'true' }}
run: dotnet nuget push .\artifacts\packages\ --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ACTIONS }}