-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (54 loc) · 1.81 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
66
name: Publish package on NuGet
on:
push:
branches: [master]
jobs:
job_1:
name: RepositoryHelpers Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "5.0.x"
- name: Restore dependencies
run: dotnet restore
working-directory: "RepositoryHelpers/"
- name: Build
run: dotnet build . --configuration Release --no-restore
working-directory: "RepositoryHelpers/"
job_2:
name: RepositoryHelpers release publish
needs: job_1
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: "5.0.x"
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
- name: Fetch all repository
run: git fetch --unshallow
- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Change version on csproj file
run: sed -i -e 's/PackageVersion>[0-9a-z.-]*</PackageVersion>'$GITVERSION_NUGETVERSION'</' RepositoryHelpers/RepositoryHelpers.csproj
- name: Restore dependencies
run: dotnet restore
working-directory: "RepositoryHelpers/"
- name: Build
run: dotnet build . --configuration Release --no-restore
working-directory: "RepositoryHelpers/"
- name: Publish NuGet
uses: brandedoutcast/[email protected]
with:
PROJECT_FILE_PATH: RepositoryHelpers/RepositoryHelpers.csproj
NUGET_KEY: ${{secrets.NUGET_TOKEN}}
VERSION_REGEX: ^\s*<PackageVersion>(.*)<\/PackageVersion>\s*$