-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (55 loc) · 1.7 KB
/
dotnet-core.yml
File metadata and controls
59 lines (55 loc) · 1.7 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
50
51
52
53
54
55
56
57
58
59
name: .NET Core
on:
push:
branches:
- master
- 'releases/**'
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: State branch
run: echo ${{ github.ref }}
- name: Update Version
uses: jacobtomlinson/gha-find-replace@master
with:
find: "[0-9]+\\</Version\\>"
replace: ${{ github.run_number }}</Version>
- name: Update Assembly Version
uses: jacobtomlinson/gha-find-replace@master
with:
find: "[0-9]+\\.[0-9]+\\</AssemblyVersion\\>"
replace: ${{ github.run_number }}.0</AssemblyVersion>
- name: Update File Version
uses: jacobtomlinson/gha-find-replace@master
with:
find: "[0-9]+\\.[0-9]+\\</FileVersion\\>"
replace: ${{ github.run_number }}.0</FileVersion>
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore
working-directory: ./src
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: ./src
- name: Test
run: dotnet test --no-restore --verbosity normal
working-directory: ./src
- name: Publish nuget package
if: contains(github.ref, 'refs/heads/releases/')
run: dotnet nuget push *.nupkg -k $nuget_api_key -s "https://api.nuget.org/v3/index.json" --skip-duplicate
env:
nuget_api_key: ${{ secrets.NUGET_API_KEY }}
working-directory: ./src/WebOsTv.Net/bin/Release/
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
if: failure()
with:
name: source
path: src