-
Notifications
You must be signed in to change notification settings - Fork 76
51 lines (43 loc) · 1.84 KB
/
main.yaml
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
on:
push:
branches:
- master
tags:
- "*"
pull_request:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # needed for gitversion, checks out all branches and tags
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- name: Build solution
run: dotnet build --configuration Release src/MethodBoundaryAspect.Fody.sln
- name: Run tests - NetFramework
run: dotnet test src\MethodBoundaryAspect.Fody.UnitTests.NetFramework --configuration Release --no-build
- name: Run tests - NetCore
run: dotnet test src\MethodBoundaryAspect.Fody.UnitTests.NetCore --configuration Release --no-build
- name: Run tests - NetCore Runtime
run: dotnet test src\MethodBoundaryAspect.Fody.RuntimeTests.NetCore --configuration Release --no-build
- name: Create the nuget package
run: dotnet pack --configuration Release --no-build src\MethodBoundaryAspect\MethodBoundaryAspect.csproj -o Artifacts/Packages
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: nupkg
path: 'Artifacts/Packages/**/*.nupkg'
- name: Publish to nuget.org
run: dotnet nuget push Artifacts/Packages/**/*.nupkg --api-key ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
if: startsWith(github.ref, 'refs/tags/v')
# - name: Publish to github packages
# run: dotnet nuget push Artifacts/Packages/**/*.nupkg -s https://nuget.pkg.github.com/vescon/index.json --skip-duplicate
# if: startsWith(github.ref, 'refs/tags/v')