Repository navigation
43 lines (35 loc) · 1.44 KB
/
Copy pathci-cd.yml
File metadata and controls
43 lines (35 loc) · 1.44 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
name: CI/CD
on:
push:
branches: [ main ]
tags: [ '**v*' ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/L5Sharp.sln
- name: Build
run: dotnet build src/L5Sharp.sln --configuration Release --no-restore
- name: Test
run: dotnet test src/L5Sharp.sln --configuration Release --no-build --verbosity normal
- name: Pack
if: contains(github.ref, 'v')
run: |
dotnet pack src/L5Sharp.Core/L5Sharp.Core.csproj --configuration Release --no-build --output nupkg
dotnet pack src/L5Sharp.Catalog/L5Sharp.Catalog.csproj --configuration Release --no-build --output nupkg
dotnet pack src/L5Sharp.Gateway/L5Sharp.Gateway.csproj --configuration Release --no-build --output nupkg
dotnet pack src/L5Sharp.Generators/L5Sharp.Generators.csproj --configuration Release --no-build --output nupkg
dotnet pack src/L5Sharp.Generators.Data/L5Sharp.Generators.Data.csproj --configuration Release --no-build --output nupkg
- name: Publish to NuGet
if: contains(github.ref, 'v')
run: dotnet nuget push nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate