Skip to content

Commit 847318d

Browse files
authored
feat(actions): add Vampire/setup-wsl@v3 (#1275)
Closes #1266.
1 parent 0475f1c commit 847318d

File tree

6 files changed

+262
-4
lines changed

6 files changed

+262
-4
lines changed

actions/Vampire/setup-wsl/v3/action

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d4e837996638afd047e7b468de70e28fe76cf75a

docs/supported-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ Click on a version to see the binding's code.
134134
* typesafegithub
135135
* [github-actions-typing](https://github.com/typesafegithub/github-actions-typing) - v0 ✅: [`GithubActionsTypingV0`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/typesafegithub/GithubActionsTypingV0.kt), v1 ✅: [`GithubActionsTypingV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/typesafegithub/GithubActionsTypingV1.kt)
136136
* Vampire
137-
* [setup-wsl](https://github.com/Vampire/setup-wsl) - v1 ✅: [`SetupWslV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/vampire/SetupWslV1.kt), v2 ✅: [`SetupWslV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/vampire/SetupWslV2.kt)
137+
* [setup-wsl](https://github.com/Vampire/setup-wsl) - v1 ✅: [`SetupWslV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/vampire/SetupWslV1.kt), v2 ✅: [`SetupWslV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/vampire/SetupWslV2.kt), v3 ✅: [`SetupWslV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/vampire/SetupWslV3.kt)
138138

139139
## Statistics
140140

141141
Number of bindings available:
142142

143143
* counting by actions: 85
144-
* counting each version separately: 157
144+
* counting each version separately: 158
145145

146146
Actions [providing typings](https://github.com/typesafegithub/github-actions-typing/) (marked with ✅ on the above list): 18

github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/vampire/SetupWslV1.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ import kotlin.collections.toTypedArray
8787
* version, or a newer version that the binding doesn't yet know about
8888
*/
8989
@Deprecated(
90-
message = "This action has a newer major version: SetupWslV2",
91-
replaceWith = ReplaceWith("SetupWslV2"),
90+
message = "This action has a newer major version: SetupWslV3",
91+
replaceWith = ReplaceWith("SetupWslV3"),
9292
)
9393
public data class SetupWslV1 private constructor(
9494
/**

github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/vampire/SetupWslV2.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@file:Suppress(
55
"DataClassPrivateConstructor",
66
"UNUSED_PARAMETER",
7+
"DEPRECATION",
78
)
89

910
package io.github.typesafegithub.workflows.actions.vampire
@@ -12,6 +13,7 @@ import io.github.typesafegithub.workflows.domain.actions.Action
1213
import io.github.typesafegithub.workflows.domain.actions.RegularAction
1314
import java.util.LinkedHashMap
1415
import kotlin.Boolean
16+
import kotlin.Deprecated
1517
import kotlin.String
1618
import kotlin.Suppress
1719
import kotlin.Unit
@@ -84,6 +86,10 @@ import kotlin.collections.toTypedArray
8486
* @param _customVersion Allows overriding action's version, for example to use a specific minor
8587
* version, or a newer version that the binding doesn't yet know about
8688
*/
89+
@Deprecated(
90+
message = "This action has a newer major version: SetupWslV3",
91+
replaceWith = ReplaceWith("SetupWslV3"),
92+
)
8793
public data class SetupWslV2 private constructor(
8894
/**
8995
* The WSL distribution to install, update, or configure.
Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
1+
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
2+
// changes will be overwritten with the next binding code regeneration.
3+
// See https://github.com/typesafegithub/github-workflows-kt for more info.
4+
@file:Suppress(
5+
"DataClassPrivateConstructor",
6+
"UNUSED_PARAMETER",
7+
)
8+
9+
package io.github.typesafegithub.workflows.actions.vampire
10+
11+
import io.github.typesafegithub.workflows.domain.actions.Action
12+
import io.github.typesafegithub.workflows.domain.actions.RegularAction
13+
import java.util.LinkedHashMap
14+
import kotlin.Boolean
15+
import kotlin.String
16+
import kotlin.Suppress
17+
import kotlin.Unit
18+
import kotlin.collections.List
19+
import kotlin.collections.Map
20+
import kotlin.collections.toList
21+
import kotlin.collections.toTypedArray
22+
23+
/**
24+
* Action: Setup WSL
25+
*
26+
* WSL Setup GitHub Action
27+
*
28+
* [Action on GitHub](https://github.com/Vampire/setup-wsl)
29+
*
30+
* @param distribution The WSL distribution to install, update, or configure.
31+
* 'Ubuntu-22.04' and 'Ubuntu-20.04' can not be used together at the same time.
32+
* They use the same WSL distribution ID, so the second that is used will not be installed
33+
* as the first one will be found as already installed by WSL distribution ID.
34+
* Valid values: 'Alpine', 'Debian', 'kali-linux', 'openSUSE-Leap-15.2', 'Ubuntu-22.04',
35+
* 'Ubuntu-20.04', 'Ubuntu-18.04', 'Ubuntu-16.04'
36+
* @param useCache Whether to use the cache for the downloaded distribution installer.
37+
* This saves time in subsequent runs, jobs, or workflows but consumes space from
38+
* the available cache space of the repository.
39+
* Refer to https://github.com/marketplace/actions/cache for current usage limits.
40+
* Default is 'true' if the cache feature is available.
41+
* Default is 'false' if the cache feature is not available, for example because it was disabled on
42+
* a GitHub Enterprise instance.
43+
* @param wslConf The content that will be written to /etc/wsl.conf of the installed distribution.
44+
* This can be used to adjust various settings as documented at
45+
* https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-for-wslconf.
46+
* This can also be used if the distribution is installed already.
47+
* @param setAsDefault Whether to set the distribution as default WSL distribution.
48+
* This can also be used if the distribution is installed already.
49+
* Default is 'true' if the distribution is going to be installed.
50+
* Default is 'false' if the distribution is only getting configured, updated, or additional
51+
* packages installed.
52+
* The first installed WSL distribution is automatically the default one, independently of this
53+
* input.
54+
* @param update Whether to update the distribution after installation.
55+
* This can also be used if the distribution is installed already.
56+
* @param additionalPackages Space separated list of additional packages to install after
57+
* distribution installation.
58+
* This can also be used if the distribution is installed already.
59+
* @param wslShellUser The distribution user that should be used to execute run-step scripts with
60+
* wsl-shell wrapper scripts
61+
* that are created or updated by the current action invocation. If no value is given, the default
62+
* user of
63+
* the distribution at script execution time is used.
64+
* @param wslShellCommand The command that is used in the wsl-shell wrapper scripts to execute the
65+
* run-step script.
66+
* The name of the wrapper scripts will be derived from the first word in this input prefixed with
67+
* 'wsl-'.
68+
* This means that for the default value, the wrapper scripts will start with 'wsl-bash'.
69+
* The run-step script file will be given as additional parameter in single quotes after the given
70+
* string,
71+
* separated with one space character. The latter point is important, if you need to escape this
72+
* space character.
73+
* If the given string contains at least once the sequence '{0}', all occurrences of it will be
74+
* replaced by the
75+
* run-step script file without any quotes or anything and it will not be given as additional
76+
* parameter.
77+
* This can be used if the script file is needed within the shell command opposed to as additional
78+
* parameter.
79+
* This input can also be used if the distribution is installed already to change the wrapper
80+
* scripts or generate
81+
* additional ones for other shells.
82+
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
83+
* the binding
84+
* @param _customVersion Allows overriding action's version, for example to use a specific minor
85+
* version, or a newer version that the binding doesn't yet know about
86+
*/
87+
public data class SetupWslV3 private constructor(
88+
/**
89+
* The WSL distribution to install, update, or configure.
90+
* 'Ubuntu-22.04' and 'Ubuntu-20.04' can not be used together at the same time.
91+
* They use the same WSL distribution ID, so the second that is used will not be installed
92+
* as the first one will be found as already installed by WSL distribution ID.
93+
* Valid values: 'Alpine', 'Debian', 'kali-linux', 'openSUSE-Leap-15.2', 'Ubuntu-22.04',
94+
* 'Ubuntu-20.04', 'Ubuntu-18.04', 'Ubuntu-16.04'
95+
*/
96+
public val distribution: SetupWslV3.Distribution? = null,
97+
/**
98+
* Whether to use the cache for the downloaded distribution installer.
99+
* This saves time in subsequent runs, jobs, or workflows but consumes space from
100+
* the available cache space of the repository.
101+
* Refer to https://github.com/marketplace/actions/cache for current usage limits.
102+
* Default is 'true' if the cache feature is available.
103+
* Default is 'false' if the cache feature is not available, for example because it was disabled
104+
* on a GitHub Enterprise instance.
105+
*/
106+
public val useCache: Boolean? = null,
107+
/**
108+
* The content that will be written to /etc/wsl.conf of the installed distribution.
109+
* This can be used to adjust various settings as documented at
110+
* https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-for-wslconf.
111+
* This can also be used if the distribution is installed already.
112+
*/
113+
public val wslConf: String? = null,
114+
/**
115+
* Whether to set the distribution as default WSL distribution.
116+
* This can also be used if the distribution is installed already.
117+
* Default is 'true' if the distribution is going to be installed.
118+
* Default is 'false' if the distribution is only getting configured, updated, or additional
119+
* packages installed.
120+
* The first installed WSL distribution is automatically the default one, independently of this
121+
* input.
122+
*/
123+
public val setAsDefault: Boolean? = null,
124+
/**
125+
* Whether to update the distribution after installation.
126+
* This can also be used if the distribution is installed already.
127+
*/
128+
public val update: Boolean? = null,
129+
/**
130+
* Space separated list of additional packages to install after distribution installation.
131+
* This can also be used if the distribution is installed already.
132+
*/
133+
public val additionalPackages: List<String>? = null,
134+
/**
135+
* The distribution user that should be used to execute run-step scripts with wsl-shell wrapper
136+
* scripts
137+
* that are created or updated by the current action invocation. If no value is given, the
138+
* default user of
139+
* the distribution at script execution time is used.
140+
*/
141+
public val wslShellUser: String? = null,
142+
/**
143+
* The command that is used in the wsl-shell wrapper scripts to execute the run-step script.
144+
* The name of the wrapper scripts will be derived from the first word in this input prefixed
145+
* with 'wsl-'.
146+
* This means that for the default value, the wrapper scripts will start with 'wsl-bash'.
147+
* The run-step script file will be given as additional parameter in single quotes after the
148+
* given string,
149+
* separated with one space character. The latter point is important, if you need to escape this
150+
* space character.
151+
* If the given string contains at least once the sequence '{0}', all occurrences of it will be
152+
* replaced by the
153+
* run-step script file without any quotes or anything and it will not be given as additional
154+
* parameter.
155+
* This can be used if the script file is needed within the shell command opposed to as
156+
* additional parameter.
157+
* This input can also be used if the distribution is installed already to change the wrapper
158+
* scripts or generate
159+
* additional ones for other shells.
160+
*/
161+
public val wslShellCommand: String? = null,
162+
/**
163+
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
164+
*/
165+
public val _customInputs: Map<String, String> = mapOf(),
166+
/**
167+
* Allows overriding action's version, for example to use a specific minor version, or a newer
168+
* version that the binding doesn't yet know about
169+
*/
170+
public val _customVersion: String? = null,
171+
) : RegularAction<SetupWslV3.Outputs>("Vampire", "setup-wsl", _customVersion ?: "v3") {
172+
public constructor(
173+
vararg pleaseUseNamedArguments: Unit,
174+
distribution: SetupWslV3.Distribution? = null,
175+
useCache: Boolean? = null,
176+
wslConf: String? = null,
177+
setAsDefault: Boolean? = null,
178+
update: Boolean? = null,
179+
additionalPackages: List<String>? = null,
180+
wslShellUser: String? = null,
181+
wslShellCommand: String? = null,
182+
_customInputs: Map<String, String> = mapOf(),
183+
_customVersion: String? = null,
184+
) : this(distribution=distribution, useCache=useCache, wslConf=wslConf,
185+
setAsDefault=setAsDefault, update=update, additionalPackages=additionalPackages,
186+
wslShellUser=wslShellUser, wslShellCommand=wslShellCommand, _customInputs=_customInputs,
187+
_customVersion=_customVersion)
188+
189+
@Suppress("SpreadOperator")
190+
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
191+
*listOfNotNull(
192+
distribution?.let { "distribution" to it.stringValue },
193+
useCache?.let { "use-cache" to it.toString() },
194+
wslConf?.let { "wsl-conf" to it },
195+
setAsDefault?.let { "set-as-default" to it.toString() },
196+
update?.let { "update" to it.toString() },
197+
additionalPackages?.let { "additional-packages" to it.joinToString(" ") },
198+
wslShellUser?.let { "wsl-shell-user" to it },
199+
wslShellCommand?.let { "wsl-shell-command" to it },
200+
*_customInputs.toList().toTypedArray(),
201+
).toTypedArray()
202+
)
203+
204+
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
205+
206+
public sealed class Distribution(
207+
public val stringValue: String,
208+
) {
209+
public object Alpine : SetupWslV3.Distribution("Alpine")
210+
211+
public object Debian : SetupWslV3.Distribution("Debian")
212+
213+
public object KaliLinux : SetupWslV3.Distribution("kali-linux")
214+
215+
public object OpenSUSELeap152 : SetupWslV3.Distribution("openSUSE-Leap-15.2")
216+
217+
public object Ubuntu2204 : SetupWslV3.Distribution("Ubuntu-22.04")
218+
219+
public object Ubuntu2004 : SetupWslV3.Distribution("Ubuntu-20.04")
220+
221+
public object Ubuntu1804 : SetupWslV3.Distribution("Ubuntu-18.04")
222+
223+
public object Ubuntu1604 : SetupWslV3.Distribution("Ubuntu-16.04")
224+
225+
public class Custom(
226+
customStringValue: String,
227+
) : SetupWslV3.Distribution(customStringValue)
228+
}
229+
230+
public class Outputs(
231+
stepId: String,
232+
) : Action.Outputs(stepId) {
233+
/**
234+
* The path to the wsl-shell wrapper that is generated by the current action invocation.
235+
* Even if the current action invocation does not actually generate the script, because
236+
* wsl-shell-command is not set explicitly and the script already exists, this output will
237+
* be set.
238+
*/
239+
public val wslShellWrapperPath: String = "steps.$stepId.outputs.wsl-shell-wrapper-path"
240+
241+
/**
242+
* The path to the distribution-specific wsl-shell wrapper that is generated by the current
243+
* action invocation.
244+
* Even if the current action invocation does not actually generate the script, because
245+
* wsl-shell-command is not set explicitly and the script already exists, this output will
246+
* be set.
247+
*/
248+
public val wslShellDistributionWrapperPath: String =
249+
"steps.$stepId.outputs.wsl-shell-distribution-wrapper-path"
250+
}
251+
}

0 commit comments

Comments
 (0)