-
Notifications
You must be signed in to change notification settings - Fork 7
49 lines (41 loc) · 1.16 KB
/
build.yaml
File metadata and controls
49 lines (41 loc) · 1.16 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
name: Build, Test and Publish Package
on:
push:
tags:
- v*
branches:
- main
- feature/*
jobs:
build:
runs-on: ubuntu-latest
env:
DOTNET_VERSION: '6.0.x'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
shell: bash
run: dotnet restore
- name: Build
shell: bash
run: dotnet build --no-restore -c Release
- name: Test
shell: bash
run: dotnet test --no-build --verbosity normal -c Release
- name: Pack Tool
shell: bash
run: dotnet pack --no-build Src/ConsoleTool/Cscli.ConsoleTool.csproj -o nupkg -c Release
- name: Publish To nuget.org
shell: bash
run: dotnet nuget push nupkg/*.nupkg -k $NUGET_TOKEN -s https://api.nuget.org/v3/index.json