-
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.49 KB
/
build-artifact.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
name: Build Artifact
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_call:
outputs:
version:
description: "Version builded"
value: ${{ jobs.build.outputs.version }}
jobs:
build:
name: Build
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
SolutionName: PochtaAPI.sln
Configuration: ${{ matrix.configuration }}
outputs:
version: ${{steps.version.outputs.version}}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
- name: Set VERSION
id: version
run: .\.github\scripts\version.ps1
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1
- name: Restore solution
run: msbuild $env:SolutionName /t:Restore /p:Configuration=$env:Configuration
- name: Build solution
run: msbuild $env:SolutionName /t:Build /p:Configuration=$env:Configuration
- name: Pack NuGet
if: matrix.configuration == 'Release'
run: dotnet pack .\PochtaAPI\PochtaAPI.csproj -c $env:Configuration
- name: Upload artifact
if: matrix.configuration == 'Release'
uses: actions/upload-artifact@v3
with:
name: PochtaAPI
path: '**\*.nupkg'
if-no-files-found: error