-
Notifications
You must be signed in to change notification settings - Fork 116
52 lines (50 loc) · 1.56 KB
/
application.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
name: Application
on:
push:
branches:
- master
tags:
- '**'
pull_request:
env:
app_release: false
app_conf: Release
nuget_url: https://api.nuget.org/v3/index.json
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Get version
run: echo "app_version=`git describe --tags`" >> $GITHUB_ENV
- name: Get release status
run: echo "app_release=`(git describe --tags --exact-match>/dev/null 2>&1 && echo true) || echo false`" >> $GITHUB_ENV
- name: Status
run: echo "Release=$app_release, version=$app_version"
- name: Compile
run: dotnet build -c $app_conf -p:Version=$app_version -p:InformationalVersion="$app_version:$GITHUB_SHA"
- name: Test net6
run: dotnet test -c $app_conf --no-build -f net6.0
- name: Test net8
run: dotnet test -c $app_conf --no-build -f net8.0
- name: Pack
working-directory: nuget
run: dotnet pack -c $app_conf --no-build -o `pwd`/artifacts -p:Version=$app_version -p:CommitSHA=$GITHUB_SHA
- uses: actions/upload-artifact
with:
name: artifacts
path: ./nuget/artifacts
- name: Publish
if: env.app_release == 'true'
env:
NUGETKEY: ${{ secrets.NUGET_KEY }}
working-directory: nuget/artifacts
run: dotnet nuget push ./*.nupkg -s $nuget_url -k $NUGETKEY