forked from twilio-labs/twilio-aspnet
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 2.42 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release
on:
workflow_dispatch:
inputs:
libraryVersion:
description: 'The version of the library to use when compiling and packaging.'
required: true
type: string
prerelease:
description: 'Is this a prerelease (alpha/beta/rc)?'
required: true
type: boolean
env:
CI: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
jobs:
build:
uses: ./.github/workflows/ci.yml
if: contains('["Swimburger","dprothero"]', github.actor)
name: Build, test, and pack
permissions:
checks: write
with:
libraryVersion: ${{ inputs.libraryVersion }}
secrets: inherit
release:
if: contains('["Swimburger","dprothero"]', github.actor)
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/download-artifact@v3
name: Download Twilio.AspNet.Common NuGet Package
with:
name: Twilio.AspNet.Common NuGet Package
- uses: actions/download-artifact@v3
name: Download Twilio.AspNet.Core NuGet Package
with:
name: Twilio.AspNet.Core NuGet Package
- uses: actions/download-artifact@v3
name: Download Twilio.AspNet.Mvc NuGet Package
with:
name: Twilio.AspNet.Mvc NuGet Package
- uses: ncipollo/release-action@v1
name: Create GitHub Release and Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.libraryVersion }}
artifacts: "*.nupkg,*.snupkg"
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ inputs.prerelease }}
- name: (Twilio.AspNet.Common) Push to NuGet
run: |
dotnet nuget push 'Twilio.AspNet.Common.${{ inputs.libraryVersion }}.nupkg' \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json
- name: (Twilio.AspNet.Core) Push to NuGet
run: |
dotnet nuget push 'Twilio.AspNet.Core.${{ inputs.libraryVersion }}.nupkg' \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json
- name: (Twilio.AspNet.Mvc) Push to NuGet
run: |
dotnet nuget push 'Twilio.AspNet.Mvc.${{ inputs.libraryVersion }}.nupkg' \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json