Skip to content

Commit 43e49f4

Browse files
committed
feat(actions): add actions/upload-artifact@v4
1 parent d482963 commit 43e49f4

File tree

8 files changed

+163
-4
lines changed

8 files changed

+163
-4
lines changed

actions/actions/upload-artifact/v4/action

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

docs/supported-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Click on a version to see the binding's code.
2828
* [setup-node](https://github.com/actions/setup-node) - v2: [`SetupNodeV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupNodeV2.kt), v3: [`SetupNodeV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupNodeV3.kt), v4: [`SetupNodeV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupNodeV4.kt)
2929
* [setup-python](https://github.com/actions/setup-python) - v2: [`SetupPythonV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupPythonV2.kt), v3: [`SetupPythonV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupPythonV3.kt), v4: [`SetupPythonV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupPythonV4.kt), v5: [`SetupPythonV5`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/SetupPythonV5.kt)
3030
* [stale](https://github.com/actions/stale) - v5: [`StaleV5`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/StaleV5.kt), v6: [`StaleV6`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/StaleV6.kt), v7: [`StaleV7`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/StaleV7.kt), v8: [`StaleV8`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/StaleV8.kt), v9: [`StaleV9`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/StaleV9.kt)
31-
* [upload-artifact](https://github.com/actions/upload-artifact) - v2: [`UploadArtifactV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/UploadArtifactV2.kt), v3: [`UploadArtifactV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/UploadArtifactV3.kt)
31+
* [upload-artifact](https://github.com/actions/upload-artifact) - v2: [`UploadArtifactV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/UploadArtifactV2.kt), v3: [`UploadArtifactV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/UploadArtifactV3.kt), v4: [`UploadArtifactV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/actions/UploadArtifactV4.kt)
3232
* anmol098
3333
* [waka-readme-stats](https://github.com/anmol098/waka-readme-stats) - v4: [`WakaReadmeStatsV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/anmol098/WakaReadmeStatsV4.kt)
3434
* anothrNick
@@ -140,6 +140,6 @@ Click on a version to see the binding's code.
140140
Number of bindings available:
141141

142142
* counting by actions: 84
143-
* counting each version separately: 142
143+
* counting each version separately: 143
144144

145145
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/actions/UploadArtifactV2.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import kotlin.collections.toTypedArray
3030
* [Action on GitHub](https://github.com/actions/upload-artifact)
3131
*/
3232
@Deprecated(
33-
message = "This action has a newer major version: UploadArtifactV3",
34-
replaceWith = ReplaceWith("UploadArtifactV3"),
33+
message = "This action has a newer major version: UploadArtifactV4",
34+
replaceWith = ReplaceWith("UploadArtifactV4"),
3535
)
3636
public data class UploadArtifactV2 private constructor(
3737
/**

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

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

910
package io.github.typesafegithub.workflows.actions.actions
1011

1112
import io.github.typesafegithub.workflows.domain.actions.Action
1213
import io.github.typesafegithub.workflows.domain.actions.RegularAction
1314
import java.util.LinkedHashMap
15+
import kotlin.Deprecated
1416
import kotlin.Int
1517
import kotlin.String
1618
import kotlin.Suppress
@@ -27,6 +29,10 @@ import kotlin.collections.toTypedArray
2729
*
2830
* [Action on GitHub](https://github.com/actions/upload-artifact)
2931
*/
32+
@Deprecated(
33+
message = "This action has a newer major version: UploadArtifactV4",
34+
replaceWith = ReplaceWith("UploadArtifactV4"),
35+
)
3036
public data class UploadArtifactV3 private constructor(
3137
/**
3238
* Artifact name
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
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.actions
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.Int
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: Upload a Build Artifact
25+
*
26+
* Upload a build artifact that can be used by subsequent workflow steps
27+
*
28+
* [Action on GitHub](https://github.com/actions/upload-artifact)
29+
*/
30+
public data class UploadArtifactV4 private constructor(
31+
/**
32+
* Artifact name
33+
*/
34+
public val name: String? = null,
35+
/**
36+
* A file, directory or wildcard pattern that describes what to upload
37+
*/
38+
public val path: List<String>,
39+
/**
40+
* The desired behavior if no files are found using the provided path.
41+
* Available Options:
42+
* warn: Output a warning but do not fail the action
43+
* error: Fail the action with an error message
44+
* ignore: Do not output any warnings or errors, the action does not fail
45+
*/
46+
public val ifNoFilesFound: UploadArtifactV4.BehaviorIfNoFilesFound? = null,
47+
/**
48+
* Duration after which artifact will expire in days. 0 means using default retention.
49+
* Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
50+
*/
51+
public val retentionDays: UploadArtifactV4.RetentionPeriod? = null,
52+
/**
53+
* The level of compression for Zlib to be applied to the artifact archive. The value can range
54+
* from 0 to 9: - 0: No compression - 1: Best speed - 6: Default compression (same as GNU Gzip) -
55+
* 9: Best compression Higher levels will result in better compression, but will take longer to
56+
* complete. For large files that are not easily compressed, a value of 0 is recommended for
57+
* significantly faster uploads.
58+
*/
59+
public val compressionLevel: UploadArtifactV4.CompressionLevel? = null,
60+
/**
61+
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
62+
*/
63+
public val _customInputs: Map<String, String> = mapOf(),
64+
/**
65+
* Allows overriding action's version, for example to use a specific minor version, or a newer
66+
* version that the binding doesn't yet know about
67+
*/
68+
public val _customVersion: String? = null,
69+
) : RegularAction<UploadArtifactV4.Outputs>("actions", "upload-artifact", _customVersion ?: "v4") {
70+
public constructor(
71+
vararg pleaseUseNamedArguments: Unit,
72+
name: String? = null,
73+
path: List<String>,
74+
ifNoFilesFound: UploadArtifactV4.BehaviorIfNoFilesFound? = null,
75+
retentionDays: UploadArtifactV4.RetentionPeriod? = null,
76+
compressionLevel: UploadArtifactV4.CompressionLevel? = null,
77+
_customInputs: Map<String, String> = mapOf(),
78+
_customVersion: String? = null,
79+
) : this(name=name, path=path, ifNoFilesFound=ifNoFilesFound, retentionDays=retentionDays,
80+
compressionLevel=compressionLevel, _customInputs=_customInputs,
81+
_customVersion=_customVersion)
82+
83+
@Suppress("SpreadOperator")
84+
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
85+
*listOfNotNull(
86+
name?.let { "name" to it },
87+
"path" to path.joinToString("\n"),
88+
ifNoFilesFound?.let { "if-no-files-found" to it.stringValue },
89+
retentionDays?.let { "retention-days" to it.integerValue.toString() },
90+
compressionLevel?.let { "compression-level" to it.integerValue.toString() },
91+
*_customInputs.toList().toTypedArray(),
92+
).toTypedArray()
93+
)
94+
95+
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
96+
97+
public sealed class BehaviorIfNoFilesFound(
98+
public val stringValue: String,
99+
) {
100+
public object Warn : UploadArtifactV4.BehaviorIfNoFilesFound("warn")
101+
102+
public object Error : UploadArtifactV4.BehaviorIfNoFilesFound("error")
103+
104+
public object Ignore : UploadArtifactV4.BehaviorIfNoFilesFound("ignore")
105+
106+
public class Custom(
107+
customStringValue: String,
108+
) : UploadArtifactV4.BehaviorIfNoFilesFound(customStringValue)
109+
}
110+
111+
public sealed class RetentionPeriod(
112+
public val integerValue: Int,
113+
) {
114+
public class Value(
115+
requestedValue: Int,
116+
) : UploadArtifactV4.RetentionPeriod(requestedValue)
117+
118+
public object Default : UploadArtifactV4.RetentionPeriod(0)
119+
}
120+
121+
public sealed class CompressionLevel(
122+
public val integerValue: Int,
123+
) {
124+
public class Value(
125+
requestedValue: Int,
126+
) : UploadArtifactV4.CompressionLevel(requestedValue)
127+
128+
public object NoCompression : UploadArtifactV4.CompressionLevel(0)
129+
130+
public object BestSpeed : UploadArtifactV4.CompressionLevel(1)
131+
132+
public object DefaultCompression : UploadArtifactV4.CompressionLevel(6)
133+
134+
public object BestCompression : UploadArtifactV4.CompressionLevel(9)
135+
}
136+
137+
public class Outputs(
138+
stepId: String,
139+
) : Action.Outputs(stepId) {
140+
/**
141+
* A unique identifier for the artifact that was just uploaded. Empty if artifact upload
142+
* failed.
143+
* This ID can be used as input to other APIs to download, delete or get more information
144+
* about an artifact: https://docs.github.com/en/rest/actions/artifacts
145+
*/
146+
public val artifactId: String = "steps.$stepId.outputs.artifact-id"
147+
}
148+
}

github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows/docsnippets/CompensatingLibrarysMissingFeaturesSnippets.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("DEPRECATION") // Use deprecated action versions, to not have to update them.
2+
13
package io.github.typesafegithub.workflows.docsnippets
24

35
import io.github.typesafegithub.workflows.actions.actions.UploadArtifactV3

github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows/yaml/StepsToYamlTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("DEPRECATION") // Use deprecated action versions, to not have to update them.
2+
13
package io.github.typesafegithub.workflows.yaml
24

35
import io.github.typesafegithub.workflows.actions.actions.CheckoutV4

0 commit comments

Comments
 (0)