Skip to content

Commit

Permalink
feat(actions): add actions/setup-go@v5
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 committed Dec 7, 2023
1 parent 70097e4 commit 1fedb2c
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 4 deletions.
Empty file.
1 change: 1 addition & 0 deletions actions/actions/setup-go/v5/commit-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0c52d547c9bc32b1aa3301fd7a9cb496313a4491
4 changes: 2 additions & 2 deletions docs/supported-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Click on a version to see the binding's code.
* [github-script](https://github.com/actions/github-script) - v6: [`GithubScriptV6`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt), v7: [`GithubScriptV7`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV7.kt)
* [labeler](https://github.com/actions/labeler) - v4: [`LabelerV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/LabelerV4.kt), v5: [`LabelerV5`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/LabelerV5.kt)
* [setup-dotnet](https://github.com/actions/setup-dotnet) - v2: [`SetupDotnetV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupDotnetV2.kt), v3: [`SetupDotnetV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupDotnetV3.kt), v4: [`SetupDotnetV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupDotnetV4.kt)
* [setup-go](https://github.com/actions/setup-go) - v3: [`SetupGoV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV3.kt), v4: [`SetupGoV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV4.kt)
* [setup-go](https://github.com/actions/setup-go) - v3: [`SetupGoV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV3.kt), v4: [`SetupGoV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV4.kt), v5: [`SetupGoV5`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupGoV5.kt)
* [setup-java](https://github.com/actions/setup-java) - v2: [`SetupJavaV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupJavaV2.kt), v3: [`SetupJavaV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupJavaV3.kt), v4: [`SetupJavaV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupJavaV4.kt)
* [setup-node](https://github.com/actions/setup-node) - v2: [`SetupNodeV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupNodeV2.kt), v3: [`SetupNodeV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupNodeV3.kt), v4: [`SetupNodeV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupNodeV4.kt)
* [setup-python](https://github.com/actions/setup-python) - v2: [`SetupPythonV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupPythonV2.kt), v3: [`SetupPythonV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupPythonV3.kt), v4: [`SetupPythonV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/library/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupPythonV4.kt)
Expand Down Expand Up @@ -142,6 +142,6 @@ Click on a version to see the binding's code.
Number of bindings available:

* counting by actions: 85
* counting each version separately: 139
* counting each version separately: 140

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 @@ -29,8 +29,8 @@ import kotlin.collections.toTypedArray
* [Action on GitHub](https://github.com/actions/setup-go)
*/
@Deprecated(
message = "This action has a newer major version: SetupGoV4",
replaceWith = ReplaceWith("SetupGoV4"),
message = "This action has a newer major version: SetupGoV5",
replaceWith = ReplaceWith("SetupGoV5"),
)
public data class SetupGoV3 private constructor(
/**
Expand Down
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.actions
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 @@ -26,6 +28,10 @@ import kotlin.collections.toTypedArray
*
* [Action on GitHub](https://github.com/actions/setup-go)
*/
@Deprecated(
message = "This action has a newer major version: SetupGoV5",
replaceWith = ReplaceWith("SetupGoV5"),
)
public data class SetupGoV4 private constructor(
/**
* The Go version to download (if necessary) and use. Supports semver spec and ranges. Be sure
Expand Down
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"
}
}

0 comments on commit 1fedb2c

Please sign in to comment.