forked from danheron/Heron.MudCalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (47 loc) · 1.54 KB
/
deploy-mudcalendar-nuget.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
name: deploy-mudcalendar-nuget
on:
workflow_dispatch:
inputs:
version:
descrption: 'Tag to publish v[0-9]+.[0-9]+.[0-9]+*'
required: true
default: ''
type: string
jobs:
get-version:
name: Get version to deploy
runs-on: ubuntu-latest
env:
VERSION: 1.0.0
outputs:
VERSION: ${{ steps.output-version.outputs.VERSION }}
steps:
- name: Set tag from input
env:
TAG: ${{ github.event.inputs.version }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: VERSION to job output
id: output-version
run: |
echo "VERSION=${{ env.VERSION }}" >> $GITHUB_OUTPUT
deploy-nuget:
name: Deploy mudcalendar nuget to nuget.org
needs: get-version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: 'refs/tags/v${{ needs.get-version.outputs.VERSION }}'
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Pack nuget package
run: dotnet pack -c Release -m:1 --output nupkgs /p:PackageVersion=${{ needs.get-version.outputs.VERSION }} /p:AssemblyVersion=${{ needs.get-version.outputs.VERSION }} /p:Version=${{ needs.get-version.outputs.VERSION }}
working-directory: './Heron.MudCalendar'
- name: Publish nuget package
run: dotnet nuget push nupkgs/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
working-directory: './Heron.MudCalendar'