-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
SetupDotnetV2.kt
123 lines (118 loc) · 5.52 KB
/
SetupDotnetV2.kt
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
"DEPRECATION",
)
package io.github.typesafegithub.workflows.actions.actions
import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: Setup .NET Core SDK
*
* Used to build and publish .NET source. Set up a specific version of the .NET and authentication
* to private NuGet repository
*
* [Action on GitHub](https://github.com/actions/setup-dotnet)
*
* @param dotnetVersion Optional SDK version(s) to use. If not provided, will install global.json
* version when available. Examples: 2.2.104, 3.1, 3.1.x
* @param globalJsonFile Optional global.json location, if your global.json isn't located in the
* root of the repo.
* @param sourceUrl Optional package source for which to set up authentication. Will consult any
* existing NuGet.config in the root of the repo and provide a temporary NuGet.config using the
* NUGET_AUTH_TOKEN environment variable as a ClearTextPassword
* @param owner Optional OWNER for using packages from GitHub Package Registry organizations/users
* other than the current repository's owner. Only used if a GPR URL is also provided in source-url
* @param configFile Optional NuGet.config location, if your NuGet.config isn't located in the root
* of the repo.
* @param includePrerelease Whether prerelease versions should be matched with non-exact versions
* (for example 5.0.0-preview.6 being matched by 5, 5.0, 5.x or 5.0.x). Defaults to false if not
* provided.
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
* the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor
* version, or a newer version that the binding doesn't yet know about
*/
@Deprecated(
message = "This action has a newer major version: SetupDotnetV4",
replaceWith = ReplaceWith("SetupDotnetV4"),
)
public data class SetupDotnetV2 private constructor(
/**
* Optional SDK version(s) to use. If not provided, will install global.json version when
* available. Examples: 2.2.104, 3.1, 3.1.x
*/
public val dotnetVersion: String? = null,
/**
* Optional global.json location, if your global.json isn't located in the root of the repo.
*/
public val globalJsonFile: String? = null,
/**
* Optional package source for which to set up authentication. Will consult any existing
* NuGet.config in the root of the repo and provide a temporary NuGet.config using the
* NUGET_AUTH_TOKEN environment variable as a ClearTextPassword
*/
public val sourceUrl: String? = null,
/**
* Optional OWNER for using packages from GitHub Package Registry organizations/users other than
* the current repository's owner. Only used if a GPR URL is also provided in source-url
*/
public val owner: String? = null,
/**
* Optional NuGet.config location, if your NuGet.config isn't located in the root of the repo.
*/
public val configFile: String? = null,
/**
* Whether prerelease versions should be matched with non-exact versions (for example
* 5.0.0-preview.6 being matched by 5, 5.0, 5.x or 5.0.x). Defaults to false if not provided.
*/
public val includePrerelease: Boolean? = null,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
*/
public val _customInputs: Map<String, String> = mapOf(),
/**
* Allows overriding action's version, for example to use a specific minor version, or a newer
* version that the binding doesn't yet know about
*/
public val _customVersion: String? = null,
) : RegularAction<Action.Outputs>("actions", "setup-dotnet", _customVersion ?: "v2") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
dotnetVersion: String? = null,
globalJsonFile: String? = null,
sourceUrl: String? = null,
owner: String? = null,
configFile: String? = null,
includePrerelease: Boolean? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(dotnetVersion=dotnetVersion, globalJsonFile=globalJsonFile, sourceUrl=sourceUrl,
owner=owner, configFile=configFile, includePrerelease=includePrerelease,
_customInputs=_customInputs, _customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
dotnetVersion?.let { "dotnet-version" to it },
globalJsonFile?.let { "global-json-file" to it },
sourceUrl?.let { "source-url" to it },
owner?.let { "owner" to it },
configFile?.let { "config-file" to it },
includePrerelease?.let { "include-prerelease" to it.toString() },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId)
}