-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (37 loc) · 1.29 KB
/
dotnet-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
name: .NET Master
on:
push:
branches: [ "master" ]
# master branch does a dotnet pack just to test the pipeline, without actually pushing anything to nuget.org.
# version numbers here do not matters.
env:
VERSION_MAJOR: 0
VERSION_MINOR: 0
VERSION_SUFFIX: "-anything"
jobs:
build:
runs-on: windows-latest
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Set Version variable
id: version
run: echo "::set-output name=PRODUCT_VERSION::${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${{ steps.date.outputs.date }}.${{ github.run_attempt }}${{ env.VERSION_SUFFIX }}"
- uses: actions/checkout@v3
- name: Setup .NET6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- name: Setup .NET8
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore SmartIOT.Connector.sln
- name: Build
run: dotnet build -c Release --no-restore SmartIOT.Connector.sln
- name: Test
run: dotnet test -c Release --no-build --verbosity normal SmartIOT.Connector.sln
- name: Pack
run: dotnet pack -c Release /p:version=${{ steps.version.outputs.PRODUCT_VERSION }} SmartIOT.Connector.sln