-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (56 loc) · 2.03 KB
/
dotnet.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
53
54
55
56
57
58
59
60
61
62
63
64
65
name: .NET
on: [ push ]
jobs:
build:
strategy:
matrix:
dotnet: [ '5.0.x' ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - ${{ matrix.dotnet }}
env:
DOTNET_NOLOGO: true
steps:
- name: Getting code
uses: actions/checkout@v2
with:
fetch-depth: 50
- name: Generate build number
if: contains(join(github.event.commits.*.message), 'fix:') ||
contains(join(github.event.commits.*.message), 'feat:') ||
contains(join(github.event.commits.*.message), 'perf:')
uses: einaregilsson/build-number@v3
with:
token: ${{ secrets.github_token }}
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Generate Package Release Notes
run: |
echo 'PACKAGE_RELEASE_NOTES<<EOF' >> $GITHUB_ENV
echo '⭐ Last 10 features:' >> $GITHUB_ENV
git log -10 --pretty=format:"- %s %cs" --grep=feat >> $GITHUB_ENV
echo '' >> $GITHUB_ENV
echo '🐞 Last 10 bug fixes:' >> $GITHUB_ENV
git log -10 --pretty=format:"- %s %cs" --grep=fix >> $GITHUB_ENV
echo '' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release
- name: Run tests
run: dotnet test --configuration Release
env:
VERYFI_USERNAME: ${{ secrets.VERYFI_USERNAME }}
VERYFI_API_KEY: ${{ secrets.VERYFI_API_KEY }}
VERYFI_CLIENT_ID: ${{ secrets.VERYFI_CLIENT_ID }}
VERYFI_CLIENT_SECRET: ${{ secrets.VERYFI_CLIENT_SECRET }}
- name: Publish
if: contains(join(github.event.commits.*.message), 'fix:') ||
contains(join(github.event.commits.*.message), 'feat:') ||
contains(join(github.event.commits.*.message), 'perf:')
run: dotnet nuget push
src\**.nupkg
--api-key ${{ secrets.NUGET_KEY }}
--source https://api.nuget.org/v3/index.json
--skip-duplicate