-
Notifications
You must be signed in to change notification settings - Fork 18
71 lines (56 loc) · 1.68 KB
/
ci.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI
permissions:
actions: write
contents: write
on: [push, pull_request]
jobs:
build:
name: .NET on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build -c Release ValvePak/ValvePak.sln
- name: Test
run: dotnet test -c Release ValvePak/ValvePak.Test/ValvePak.Test.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput='./lcov.info' /p:Include="[ValvePak*]*"
- name: Create nupkg
run: dotnet pack --configuration Release ValvePak/ValvePak/ValvePak.csproj
- name: Upload nupkg
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: nupkg
path: 'ValvePak/ValvePak/bin/Release/*.nupkg'
- name: Upload test coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./ValvePak/ValvePak.Test/lcov.info
fail_ci_if_error: true
verbose: true
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display artifacts folder structure
run: ls -Rl
working-directory: artifacts
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
files: artifacts/nupkg/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}