-
Notifications
You must be signed in to change notification settings - Fork 16
39 lines (37 loc) · 1.46 KB
/
dotnet.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
name: .NET
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
APP_BUILD_VERSION: ${{ format('3.1.{0}', github.run_number) }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Setup .NET 3.1.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: "3.1.x"
- name: Package (debug)
run: dotnet pack -p:PackageVersion=${{ env.APP_BUILD_VERSION }}
- name: Package (release)
run: dotnet pack -c Release -p:PackageVersion=${{ env.APP_BUILD_VERSION }}
- name: Acceptance test
if: ${{ matrix.os == 'windows-latest' }}
run: dotnet test -p:PackageVersion=${{ env.APP_BUILD_VERSION }} test/Xunit.Xml.TestLogger.AcceptanceTests/Xunit.Xml.TestLogger.AcceptanceTests.csproj
- name: Publish packages
if: ${{ github.event_name == 'push' && matrix.os == 'windows-latest' }}
run: |
$packageFile = (Get-ChildItem src/package/bin/Release/*.nupkg).FullName
dotnet nuget push "$packageFile" --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/spekt/index.json
dotnet nuget push "$packageFile" --api-key ${{ secrets.SPEKT_MYGET_KEY }} --source https://www.myget.org/F/spekt/api/v3/index.json