-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.67 KB
/
dotnetcore.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
name: .NET Core
on:
push:
branches:
- '!master'
paths:
- 'src/**'
pull_request:
branches:
- master
paths:
- 'src/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.2.x'
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.200
- name: Install dependencies
run: dotnet restore src/sampleapi.csproj
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- run: |
echo "Version: ${{ steps.gitversion.outputs.semver }}"
- name: Build
run: dotnet build src/sampleapi.csproj --configuration Release --no-restore -p:version=${{ steps.gitversion.outputs.semver }}
- name: Create the package
run: dotnet pack src/sampleapi.csproj --configuration Release -p:version=${{ steps.gitversion.outputs.semver }}
- uses: actions/upload-artifact@v2
with:
name: nuget-packages
path: "**/*.nupkg"
- run: |
echo "Version: ${{ github.token }}"
- name: Add GPR Source
run: dotnet nuget add source https://nuget.pkg.github.com/moattarwork/index.json -n "GPR" -u moattarwork -p ${{ github.token }} --store-password-in-clear-text --valid-authentication-types basic
- name: Publish the package to github packages
run: dotnet nuget push "**/*.nupkg" -s 'GPR' --skip-duplicate