Skip to content

Commit

Permalink
feat(actions): add actions/download-artifact@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 committed Dec 22, 2023
1 parent ecaf74d commit d482963
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 4 deletions.
Empty file.
1 change: 1 addition & 0 deletions actions/actions/download-artifact/v4/commit-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110
4 changes: 2 additions & 2 deletions docs/supported-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Click on a version to see the binding's code.
* [cache](https://github.com/actions/cache) - v2: [`CacheV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV2.kt), v3: [`CacheV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CacheV3.kt)
* [checkout](https://github.com/actions/checkout) - v2: [`CheckoutV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CheckoutV2.kt), v3: [`CheckoutV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CheckoutV3.kt), v4: [`CheckoutV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CheckoutV4.kt)
* [create-release](https://github.com/actions/create-release) - v1: [`CreateReleaseV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/CreateReleaseV1.kt)
* [download-artifact](https://github.com/actions/download-artifact) - v2: [`DownloadArtifactV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV2.kt), v3: [`DownloadArtifactV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV3.kt)
* [download-artifact](https://github.com/actions/download-artifact) - v2: [`DownloadArtifactV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV2.kt), v3: [`DownloadArtifactV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV3.kt), v4: [`DownloadArtifactV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/DownloadArtifactV4.kt)
* [first-interaction](https://github.com/actions/first-interaction) - v1: [`FirstInteractionV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/FirstInteractionV1.kt)
* [github-script](https://github.com/actions/github-script) - v6: [`GithubScriptV6`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/GithubScriptV6.kt), v7: [`GithubScriptV7`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/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 ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/LabelerV4.kt), v5: [`LabelerV5`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/LabelerV5.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: 141
* counting each version separately: 142

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/download-artifact)
*/
@Deprecated(
message = "This action has a newer major version: DownloadArtifactV3",
replaceWith = ReplaceWith("DownloadArtifactV3"),
message = "This action has a newer major version: DownloadArtifactV4",
replaceWith = ReplaceWith("DownloadArtifactV4"),
)
public data class DownloadArtifactV2 private constructor(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
@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.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/download-artifact)
*/
@Deprecated(
message = "This action has a newer major version: DownloadArtifactV4",
replaceWith = ReplaceWith("DownloadArtifactV4"),
)
public data class DownloadArtifactV3 private constructor(
/**
* Artifact name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// 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: Download a Build Artifact
*
* Download a build artifact that was previously uploaded in the workflow by the upload-artifact
* action
*
* [Action on GitHub](https://github.com/actions/download-artifact)
*/
public data class DownloadArtifactV4 private constructor(
/**
* Name of the artifact to download. If unspecified, all artifacts for the run are downloaded.
*/
public val name: String? = null,
/**
* Destination path. Supports basic tilde expansion. Defaults to $GITHUB_WORKSPACE
*/
public val path: String? = null,
/**
* A glob pattern matching the artifacts that should be downloaded. Ignored if name is
* specified.
*/
public val pattern: String? = null,
/**
* When multiple artifacts are matched, this changes the behavior of the destination
* directories. If true, the downloaded artifacts will be in the same directory specified by path.
* If false, the downloaded artifacts will be extracted into individual named directories within
* the specified path.
*/
public val mergeMultiple: Boolean? = null,
/**
* The GitHub token used to authenticate with the GitHub API. This is required when downloading
* artifacts from a different repository or from a different workflow run. If this is not
* specified, the action will attempt to download artifacts from the current repository and the
* current workflow run.
*/
public val githubToken: String? = null,
/**
* The repository owner and the repository name joined together by "/". If github-token is
* specified, this is the repository that artifacts will be downloaded from.
*/
public val repository: String? = null,
/**
* The id of the workflow run where the desired download artifact was uploaded from. If
* github-token is specified, this is the run that artifacts will be downloaded from.
*/
public val runId: String? = 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<DownloadArtifactV4.Outputs>("actions", "download-artifact", _customVersion ?:
"v4") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
name: String? = null,
path: String? = null,
pattern: String? = null,
mergeMultiple: Boolean? = null,
githubToken: String? = null,
repository: String? = null,
runId: String? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(name=name, path=path, pattern=pattern, mergeMultiple=mergeMultiple,
githubToken=githubToken, repository=repository, runId=runId,
_customInputs=_customInputs, _customVersion=_customVersion)

@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
name?.let { "name" to it },
path?.let { "path" to it },
pattern?.let { "pattern" to it },
mergeMultiple?.let { "merge-multiple" to it.toString() },
githubToken?.let { "github-token" to it },
repository?.let { "repository" to it },
runId?.let { "run-id" to it },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)

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

public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* Path of artifact download
*/
public val downloadPath: String = "steps.$stepId.outputs.download-path"
}
}

0 comments on commit d482963

Please sign in to comment.