Skip to content

Commit

Permalink
feat(actions): add microsoft/setup-msbuild@v2
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 committed Feb 5, 2024
1 parent 2340366 commit 6b08eda
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 2 deletions.
Empty file.
1 change: 1 addition & 0 deletions actions/microsoft/setup-msbuild/v2/commit-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce
4 changes: 2 additions & 2 deletions docs/supported-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Click on a version to see the binding's code.
* mi-kas
* [kover-report](https://github.com/mi-kas/kover-report) - v1 ✅: [`KoverReportV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/mikas/KoverReportV1.kt)
* microsoft
* [setup-msbuild](https://github.com/microsoft/setup-msbuild) - v1 ✅: [`SetupMsbuildV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/microsoft/SetupMsbuildV1.kt)
* [setup-msbuild](https://github.com/microsoft/setup-msbuild) - v1 ✅: [`SetupMsbuildV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/microsoft/SetupMsbuildV1.kt), v2 ✅: [`SetupMsbuildV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/microsoft/SetupMsbuildV2.kt)
* nexus-actions
* [create-nexus-staging-repo](https://github.com/nexus-actions/create-nexus-staging-repo) - v1 ✅: [`CreateNexusStagingRepoV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/nexusactions/CreateNexusStagingRepoV1.kt)
* [drop-nexus-staging-repo](https://github.com/nexus-actions/drop-nexus-staging-repo) - v1 ✅: [`DropNexusStagingRepoV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/nexusactions/DropNexusStagingRepoV1.kt)
Expand Down Expand Up @@ -140,6 +140,6 @@ Click on a version to see the binding's code.
Number of bindings available:

* counting by actions: 84
* counting each version separately: 153
* counting each version separately: 154

Actions [providing typings](https://github.com/typesafegithub/github-actions-typing/) (marked with ✅ on the above list): 18
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
"DEPRECATION",
)

package io.github.typesafegithub.workflows.actions.microsoft
Expand All @@ -12,6 +13,7 @@ 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
Expand All @@ -36,6 +38,10 @@ import kotlin.collections.toTypedArray
* @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: SetupMsbuildV2",
replaceWith = ReplaceWith("SetupMsbuildV2"),
)
public data class SetupMsbuildV1 private constructor(
/**
* Folder location of where vswhere.exe is located if a self-hosted agent
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
// 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",
)

package io.github.typesafegithub.workflows.actions.microsoft

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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray

/**
* Action: setup-msbuild
*
* Helps set up MSBuild into PATH for later usage.
*
* [Action on GitHub](https://github.com/microsoft/setup-msbuild)
*
* @param vswherePath Folder location of where vswhere.exe is located if a self-hosted agent
* @param vsVersion Version of Visual Studio to search; defaults to latest if not specified
* @param vsPrerelease Enable searching for pre-release versions of Visual Studio/MSBuild
* @param msbuildArchitecture The preferred processor architecture of MSBuild. Can be either "x86",
* "x64", or "arm64". "x64" is only available from Visual Studio version 17.0 and later.
* @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
*/
public data class SetupMsbuildV2 private constructor(
/**
* Folder location of where vswhere.exe is located if a self-hosted agent
*/
public val vswherePath: String? = null,
/**
* Version of Visual Studio to search; defaults to latest if not specified
*/
public val vsVersion: String? = null,
/**
* Enable searching for pre-release versions of Visual Studio/MSBuild
*/
public val vsPrerelease: Boolean? = null,
/**
* The preferred processor architecture of MSBuild. Can be either "x86", "x64", or "arm64".
* "x64" is only available from Visual Studio version 17.0 and later.
*/
public val msbuildArchitecture: SetupMsbuildV2.Architecture? = 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<SetupMsbuildV2.Outputs>("microsoft", "setup-msbuild", _customVersion ?: "v2") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
vswherePath: String? = null,
vsVersion: String? = null,
vsPrerelease: Boolean? = null,
msbuildArchitecture: SetupMsbuildV2.Architecture? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(vswherePath=vswherePath, vsVersion=vsVersion, vsPrerelease=vsPrerelease,
msbuildArchitecture=msbuildArchitecture, _customInputs=_customInputs,
_customVersion=_customVersion)

@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
vswherePath?.let { "vswhere-path" to it },
vsVersion?.let { "vs-version" to it },
vsPrerelease?.let { "vs-prerelease" to it.toString() },
msbuildArchitecture?.let { "msbuild-architecture" to it.stringValue },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)

override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)

public sealed class Architecture(
public val stringValue: String,
) {
public object X86 : SetupMsbuildV2.Architecture("x86")

public object X64 : SetupMsbuildV2.Architecture("x64")

public object Arm64 : SetupMsbuildV2.Architecture("arm64")

public class Custom(
customStringValue: String,
) : SetupMsbuildV2.Architecture(customStringValue)
}

public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* The resulting location of msbuild for your inputs
*/
public val msbuildPath: String = "steps.$stepId.outputs.msbuildPath"
}
}

0 comments on commit 6b08eda

Please sign in to comment.