-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (39 loc) · 1.31 KB
/
nuget-release.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
name: Release Package Version
on:
push:
#branches: [ main ]
tags:
- v*
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: '([pre0-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: 7.0.x
- name: Restore dependencies
run: dotnet restore ./Fluent.Http.sln
- name: Build
run: dotnet build ./Fluent.Http.sln
- name: Pack
run: dotnet pack ./src/Fluent.Http/Fluent.Http.csproj -p:PackageVersion='${{ steps.regex-match.outputs.match }}' --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: fluent-http-pkg-v${{ steps.regex-match.outputs.match }}
path: packages/