-
Notifications
You must be signed in to change notification settings - Fork 59
65 lines (59 loc) · 1.76 KB
/
build.yml
File metadata and controls
65 lines (59 loc) · 1.76 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
60
61
62
63
64
65
name: CI Build
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: windows-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Set env
if: startsWith( github.ref, 'refs/tags/v' )
run: |
chcp 65001 #set code page to utf-8
$RELEASE_VERSION=$env:GITHUB_REF.Replace('refs/tags/', '')
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $env:GITHUB_ENV
echo ("Version=" + $RELEASE_VERSION.Substring(1)) >> $env:GITHUB_ENV
- name: Restore
run: dotnet tool restore
- name: Build
run: dotnet build -c Release
- name: Test
run: dotnet test --no-build -c Release tests
- name: Pack
run: dotnet pack --no-restore -c Release --include-symbols -o bin
- name: Upload Test Results
if: failure()
uses: actions/upload-artifact@v4
with:
name: verify-test-results
path: |
**/*.received.*
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: nupkg-${{ matrix.runs-on }}
path: ./bin/*nupkg
- name: Push
if: startsWith( github.ref, 'refs/tags/v' )
run: dotnet nuget push bin\*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }}