-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 2.12 KB
/
dotnet.yml
File metadata and controls
52 lines (48 loc) · 2.12 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
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Install SonarScanner
run: dotnet tool install dotnet-sonarscanner --global
- name: Restore dependencies
run: dotnet restore
- name: Sonar Begin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet-sonarscanner begin /k:"YulerB_SplunkClientDataReader" /o:"yulerb" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vstest.reportsPaths=**/*.trx /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml /v:1.0.1.${{ github.run_number }} /d:sonar.links.ci=https://github.com/YulerB/SplunkClientDataReader/actions/runs/${{ github.run_id }} /d:sonar.links.scm=https://github.com/YulerB/SplunkClientDataReader
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Sonar End
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
- name: Pack
run: dotnet pack --configuration Release
- name: PushNuget
run: dotnet nuget push "bin/Release/SplunkClientDataReader.1.0.7.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json" --skip-duplicate
- name: PushGit
run: dotnet nuget push "bin/Release/SplunkClientDataReader.1.0.7.nupkg" --api-key ${GITHUB_TOKEN} --source "https://nuget.pkg.github.com/SplunkClientDataReader/index.json" --skip-duplicate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}