-
Notifications
You must be signed in to change notification settings - Fork 23
48 lines (38 loc) · 1.14 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
name: Build, Test and Release
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ released ]
env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: |
dotnet build --configuration Release --no-restore
dotnet pack -c Release Jeffijoe.MessageFormat/Jeffijoe.MessageFormat.csproj
- name: Test
working-directory: ./src
run: dotnet test --no-restore --verbosity normal
- name: Publish to NuGet
if: github.event_name == 'release' # Only publish on Release creation.
working-directory: ./src
run: |
dotnet nuget push Jeffijoe.MessageFormat/**/*.nupkg --api-key ${{ secrets.NUGET_JEFFIJOE_KEY }} --source https://api.nuget.org/v3/index.json