-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(actions): add actions/setup-go@v5
- Loading branch information
Showing
6 changed files
with
141 additions
and
4 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0c52d547c9bc32b1aa3301fd7a9cb496313a4491 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV5.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
// 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.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.String | ||
import kotlin.Suppress | ||
import kotlin.Unit | ||
import kotlin.collections.Map | ||
import kotlin.collections.toList | ||
import kotlin.collections.toTypedArray | ||
|
||
/** | ||
* Action: Setup Go environment | ||
* | ||
* Setup a Go environment and add it to the PATH | ||
* | ||
* [Action on GitHub](https://github.com/actions/setup-go) | ||
*/ | ||
public data class SetupGoV5 private constructor( | ||
/** | ||
* The Go version to download (if necessary) and use. Supports semver spec and ranges. Be sure | ||
* to enclose this option in single quotation marks. | ||
*/ | ||
public val goVersion: String? = null, | ||
/** | ||
* Path to the go.mod or go.work file. | ||
*/ | ||
public val goVersionFile: String? = null, | ||
/** | ||
* Set this option to true if you want the action to always check for the latest available | ||
* version that satisfies the version spec | ||
*/ | ||
public val checkLatest: Boolean? = null, | ||
/** | ||
* Used to pull Go distributions from go-versions. Since there's a default, this is typically | ||
* not supplied by the user. When running this action on github.com, the default value is | ||
* sufficient. When running on GHES, you can pass a personal access token for github.com if you are | ||
* experiencing rate limiting. | ||
*/ | ||
public val token: String? = null, | ||
/** | ||
* Used to specify whether caching is needed. Set to true, if you'd like to enable caching. | ||
*/ | ||
public val cache: Boolean? = null, | ||
/** | ||
* Used to specify the path to a dependency file - go.sum | ||
*/ | ||
public val cacheDependencyPath: String? = null, | ||
/** | ||
* Target architecture for Go to use. Examples: x86, x64. Will use system architecture by | ||
* default. | ||
*/ | ||
public val architecture: SetupGoV5.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<SetupGoV5.Outputs>("actions", "setup-go", _customVersion ?: "v5") { | ||
public constructor( | ||
vararg pleaseUseNamedArguments: Unit, | ||
goVersion: String? = null, | ||
goVersionFile: String? = null, | ||
checkLatest: Boolean? = null, | ||
token: String? = null, | ||
cache: Boolean? = null, | ||
cacheDependencyPath: String? = null, | ||
architecture: SetupGoV5.Architecture? = null, | ||
_customInputs: Map<String, String> = mapOf(), | ||
_customVersion: String? = null, | ||
) : this(goVersion=goVersion, goVersionFile=goVersionFile, checkLatest=checkLatest, token=token, | ||
cache=cache, cacheDependencyPath=cacheDependencyPath, architecture=architecture, | ||
_customInputs=_customInputs, _customVersion=_customVersion) | ||
|
||
@Suppress("SpreadOperator") | ||
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf( | ||
*listOfNotNull( | ||
goVersion?.let { "go-version" to it }, | ||
goVersionFile?.let { "go-version-file" to it }, | ||
checkLatest?.let { "check-latest" to it.toString() }, | ||
token?.let { "token" to it }, | ||
cache?.let { "cache" to it.toString() }, | ||
cacheDependencyPath?.let { "cache-dependency-path" to it }, | ||
architecture?.let { "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 : SetupGoV5.Architecture("x86") | ||
|
||
public object X64 : SetupGoV5.Architecture("x64") | ||
|
||
public class Custom( | ||
customStringValue: String, | ||
) : SetupGoV5.Architecture(customStringValue) | ||
} | ||
|
||
public class Outputs( | ||
stepId: String, | ||
) : Action.Outputs(stepId) { | ||
/** | ||
* The installed Go version. Useful when given a version range as input. | ||
*/ | ||
public val goVersion: String = "steps.$stepId.outputs.go-version" | ||
|
||
/** | ||
* A boolean value to indicate if a cache was hit | ||
*/ | ||
public val cacheHit: String = "steps.$stepId.outputs.cache-hit" | ||
} | ||
} |