forked from IEvangelist/azure-cosmos-dotnet-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.68 KB
/
nuget-publish.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
name: Release Package Version
on:
push:
tags:
- 2.*
jobs:
build:
if: github.event.base_ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Print Tag Ref
run: echo $GITHUB_REF
- name: Extract Version Number
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ github.ref }}
regex: '[0-9.]+'
- name: Print Version Number
run: echo '${{ steps.regex-match.outputs.match }}'
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
3.1.402
6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
dotnet build --configuration Release --no-restore
- name: Test
run: |
dotnet test --no-restore --verbosity normal
- name: Pack Microsoft.Azure.CosmosRepository
run: |
dotnet pack ./src/Microsoft.Azure.CosmosRepository/Microsoft.Azure.CosmosRepository.csproj --output packages
- name: Pack Microsoft.Azure.CosmosRepository.AspNetCore
run: |
dotnet pack ./src/Microsoft.Azure.CosmosRepository.AspNetCore/Microsoft.Azure.CosmosRepository.AspNetCore.csproj --output packages
- name: Publish Package
run: |
nuget push **\*.nupkg -NoSymbols -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}
- name: Upload Package
uses: actions/upload-artifact@v2
with:
name: IEvangelist.Azure.CosmosRepository.V${{ steps.regex-match.outputs.match }}
path: packages/