-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (48 loc) · 1.74 KB
/
build_test.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
name: .NET
on:
push:
branches: [ main, 'version/**', 'pr/**', 'pr-**' ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ main, 'version/**', 'pr/**', 'pr-**' ]
types: [opened, synchronize, reopened]
paths-ignore:
- '**/*.md'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
env:
version: '2.1.0'
versionFile: '2.1.0'
packDotNetVersion: '8'
strategy:
matrix:
os: [ ubuntu-latest ]
dotnet-version: [ '3.x', '6.x', '8.0' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore dependencies
run: dotnet restore ./Src/TextTemplating.sln
- name: Build
run: dotnet build --no-restore ./Src/TextTemplating.sln
- name: Test
run: dotnet test --no-build --verbosity normal ./Src/TextTemplating.sln
- name: Pack
if: startsWith(matrix.dotnet-version, env.packDotNetVersion)
run: |
echo "Packing Version: ${{ env.version }}, File Version: ${{ env.versionFile }}"
dotnet build ./Src/TextTemplating.sln /verbosity:minimal --configuration release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:ContinuousIntegrationBuild=true /p:PackageOutputPath=${{ github.workspace }}/artifacts/ /p:Version=${{ env.version }} /p:FileVersion=${{ env.versionFile }}
dotnet pack ./Src/TextTemplating.sln /verbosity:minimal --configuration release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: startsWith(matrix.dotnet-version, env.packDotNetVersion)
with:
name: Packages_${{ env.version }}
path: ${{ github.workspace }}/artifacts/