-
Notifications
You must be signed in to change notification settings - Fork 16
59 lines (55 loc) · 1.85 KB
/
Copy pathbuild.yml
File metadata and controls
59 lines (55 loc) · 1.85 KB
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
name: .NET
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '5.0.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore
- name: Test
run: dotnet test -c Release --no-build
- name: Pack
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
shell: pwsh
run: |
$GITHUB_REF = $env:GITHUB_REF
if (!($GITHUB_REF -match 'refs/tags/v(\d+\.\d+\.\d+)')) {
Write-Error "Failed to parse version from GITHUB_REF: $GITHUB_REF"
exit 1
}
$Version = $matches[1]
Write-Host "Version: $Version"
& dotnet pack -c Release -p:Version=$Version -p:PackageVersion=$VERSION -p:AssemblyVersion=$Version -p:FileVersion=$Version -p:InformationalVersion=$Version CsvTextFieldParser/CsvTextFieldParser.csproj
exit $LastExitCode
- name: Upload Artifact Nupkg
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v2
with:
name: nupkg
path: ./CsvTextFieldParser/bin/Release/*.*nupkg
- name: Upload Artifact Bin
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v2
with:
name: bin
path: ./CsvTextFieldParser/bin/Release/netstandard2.0/*.*