-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
45 lines (42 loc) · 1.41 KB
/
action.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
name: "Warren - Configure .NET SDK"
description: "Installs .NET SDK and configures NuGet package source for Warren Packages"
branding:
icon: "settings"
color: "red"
inputs:
dotnet-version:
description: "The SDK version (or versions) to be installed"
required: true
default: "6.0.x"
nuget-user:
description: "User that will read/write packages"
required: true
nuget-api-key:
description: "The API key to authorize read/write packages"
required: true
nuget-source:
description: "The URL to NuGet source index.json"
required: true
nuget-source-name:
description: "The source name to be saved in nuget.config file"
required: true
runs:
using: composite
steps:
- name: Install .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet-version}}
- name: Clear Previous Sources
shell: bash
env:
NUGET_SOURCE_NAME: ${{ inputs.nuget-source-name }}
run: dotnet nuget remove source $NUGET_SOURCE_NAME || true
- name: Add NuGet Source
shell: bash
env:
NUGET_USER: ${{ inputs.nuget-user }}
NUGET_API_KEY: ${{ inputs.nuget-api-key }}
NUGET_SOURCE: ${{ inputs.nuget-source }}
NUGET_SOURCE_NAME: ${{ inputs.nuget-source-name }}
run: dotnet nuget add source $NUGET_SOURCE -n $NUGET_SOURCE_NAME -u $NUGET_USER -p $NUGET_API_KEY --store-password-in-clear-text || true