-
-
Notifications
You must be signed in to change notification settings - Fork 22
45 lines (36 loc) · 1.32 KB
/
master.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
name: master
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'
- name: Determine Version
id: version # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- name: Print GitVersion_MajorMinorPatch
run: echo "The GitVersion_MajorMinorPatch is ${{ env.GitVersion_MajorMinorPatch }}"
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
- name: Install dependencies
run: dotnet restore CronScheduler.sln
- name: Build
run: dotnet build CronScheduler.sln --configuration Release --no-restore /p:Version=${{ env.GitVersion_MajorMinorPatch }}
- name: Test
run: dotnet test
- name: Publish NuGet package
run: |
dotnet pack CronScheduler.sln --configuration Release --no-build --output ./nupkg /p:Version=${{ env.GitVersion_MajorMinorPatch }} /p:Version=${{ env.GitVersion_MajorMinorPatch }}
dotnet nuget push ./nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate