-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (38 loc) · 1.32 KB
/
build-test-publish.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
name: Build, Test and Publish
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.302
source-url: https://nuget.pkg.github.com/lucassklp/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install dependencies
run: dotnet restore
- name: Test
run: dotnet test --collect:"XPlat Code Coverage" --no-restore --verbosity normal
- name: Moving test coverage result to root folder
run: |
mv Rx.Http.Tests/TestResults/**/coverage.cobertura.xml ./
- name: Send test coverage to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.cobertura.xml
- name: Pack
run: |
dotnet pack -c Release -o .
- name: Push Rx.Http to GitHub registry
run: |
dotnet nuget push "*.nupkg" -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/lucassklp/index.json --skip-duplicate
- name: Push Rx.Http to NuGet registry
run: |
dotnet nuget push "*.nupkg" -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate