-
Notifications
You must be signed in to change notification settings - Fork 13
40 lines (33 loc) · 1.26 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
name: dotnet package
on: [push]
jobs:
build:
runs-on: ubuntu-latest
env:
# set value
SHOULD_DEPLOY: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
strategy:
matrix:
dotnet-version: ["3.1.x", "6.0.x", "7.0.x"]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Restore
run: dotnet restore GrowthBook/GrowthBook.csproj
- name: Build
run: dotnet build GrowthBook/GrowthBook.csproj --configuration Release
# current tests are written for visual studio only
- name: Test
run: dotnet test GrowthBook.Tests/GrowthBook.Tests.csproj --logger:"console;verbosity=normal"
- name: pack
run: dotnet pack --configuration Release --no-build --output dist GrowthBook/GrowthBook.csproj
# # Deploy if SHOULD_DEPLOY is set to true
# - name: publish
# if: ${{ env.SHOULD_DEPLOY }}
# run: dotnet nuget push dist/*.nupkg --api-key $NUGET_KEY --source $NUGET_SOURCE
# env:
# NUGET_KEY: ${{ secrets.NUGET_KEY }}
# NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}