Skip to content

Commit a16982b

Browse files
authored
feat(actions): add softprops/action-gh-release@v2 (#1327)
1 parent e6acd43 commit a16982b

File tree

5 files changed

+234
-2
lines changed

5 files changed

+234
-2
lines changed

actions/softprops/action-gh-release/v2/action

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

docs/supported-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Click on a version to see the binding's code.
122122
* ruby
123123
* [setup-ruby](https://github.com/ruby/setup-ruby) - v1: [`SetupRubyV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/ruby/SetupRubyV1.kt)
124124
* softprops
125-
* [action-gh-release](https://github.com/softprops/action-gh-release) - v1: [`ActionGhReleaseV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/softprops/ActionGhReleaseV1.kt)
125+
* [action-gh-release](https://github.com/softprops/action-gh-release) - v1: [`ActionGhReleaseV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/softprops/ActionGhReleaseV1.kt), v2: [`ActionGhReleaseV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/softprops/ActionGhReleaseV2.kt)
126126
* stefanzweifel
127127
* [git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) - v4: [`GitAutoCommitActionV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/stefanzweifel/GitAutoCommitActionV4.kt), v5: [`GitAutoCommitActionV5`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/stefanzweifel/GitAutoCommitActionV5.kt)
128128
* subosito
@@ -141,6 +141,6 @@ Click on a version to see the binding's code.
141141
Number of bindings available:
142142

143143
* counting by actions: 85
144-
* counting each version separately: 160
144+
* counting each version separately: 161
145145

146146
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/softprops/ActionGhReleaseV1.kt

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

910
package io.github.typesafegithub.workflows.actions.softprops
@@ -12,6 +13,7 @@ import io.github.typesafegithub.workflows.domain.actions.Action
1213
import io.github.typesafegithub.workflows.domain.actions.RegularAction
1314
import java.util.LinkedHashMap
1415
import kotlin.Boolean
16+
import kotlin.Deprecated
1517
import kotlin.String
1618
import kotlin.Suppress
1719
import kotlin.Unit
@@ -51,6 +53,10 @@ import kotlin.collections.toTypedArray
5153
* @param _customVersion Allows overriding action's version, for example to use a specific minor
5254
* version, or a newer version that the binding doesn't yet know about
5355
*/
56+
@Deprecated(
57+
message = "This action has a newer major version: ActionGhReleaseV2",
58+
replaceWith = ReplaceWith("ActionGhReleaseV2"),
59+
)
5460
public data class ActionGhReleaseV1 private constructor(
5561
/**
5662
* Note-worthy description of changes in release
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
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.softprops
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.Boolean
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: GH Release
25+
*
26+
* Github Action for creating Github Releases
27+
*
28+
* [Action on GitHub](https://github.com/softprops/action-gh-release)
29+
*
30+
* @param body Note-worthy description of changes in release
31+
* @param bodyPath Path to load note-worthy description of changes in release from
32+
* @param name Gives the release a custom name. Defaults to tag name
33+
* @param tagName Gives a tag name. Defaults to github.GITHUB_REF
34+
* @param draft Creates a draft release. Defaults to false
35+
* @param prerelease Identify the release as a prerelease. Defaults to false
36+
* @param files Newline-delimited list of path globs for asset files to upload
37+
* @param failOnUnmatchedFiles Fails if any of the `files` globs match nothing. Defaults to false
38+
* @param repository Repository to make releases against, in <owner>/<repo> format
39+
* @param token Authorized secret GitHub Personal Access Token. Defaults to github.token
40+
* @param targetCommitish Commitish value that determines where the Git tag is created from. Can be
41+
* any branch or commit SHA.
42+
* @param discussionCategoryName If specified, a discussion of the specified category is created and
43+
* linked to the release. The value must be a category that already exists in the repository. If there
44+
* is already a discussion linked to the release, this parameter is ignored.
45+
* @param generateReleaseNotes Whether to automatically generate the name and body for this release.
46+
* If name is specified, the specified name will be used; otherwise, a name will be automatically
47+
* generated. If body is specified, the body will be pre-pended to the automatically generated notes.
48+
* @param appendBody Append to existing body instead of overwriting it. Default is false.
49+
* @param makeLatest Specifies whether this release should be set as the latest release for the
50+
* repository. Drafts and prereleases cannot be set as latest. Can be `true`, `false`, or `legacy`.
51+
* Uses GitHub api default if not provided
52+
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
53+
* the binding
54+
* @param _customVersion Allows overriding action's version, for example to use a specific minor
55+
* version, or a newer version that the binding doesn't yet know about
56+
*/
57+
public data class ActionGhReleaseV2 private constructor(
58+
/**
59+
* Note-worthy description of changes in release
60+
*/
61+
public val body: String? = null,
62+
/**
63+
* Path to load note-worthy description of changes in release from
64+
*/
65+
public val bodyPath: String? = null,
66+
/**
67+
* Gives the release a custom name. Defaults to tag name
68+
*/
69+
public val name: String? = null,
70+
/**
71+
* Gives a tag name. Defaults to github.GITHUB_REF
72+
*/
73+
public val tagName: String? = null,
74+
/**
75+
* Creates a draft release. Defaults to false
76+
*/
77+
public val draft: Boolean? = null,
78+
/**
79+
* Identify the release as a prerelease. Defaults to false
80+
*/
81+
public val prerelease: Boolean? = null,
82+
/**
83+
* Newline-delimited list of path globs for asset files to upload
84+
*/
85+
public val files: List<String>? = null,
86+
/**
87+
* Fails if any of the `files` globs match nothing. Defaults to false
88+
*/
89+
public val failOnUnmatchedFiles: Boolean? = null,
90+
/**
91+
* Repository to make releases against, in <owner>/<repo> format
92+
*/
93+
public val repository: String? = null,
94+
/**
95+
* Authorized secret GitHub Personal Access Token. Defaults to github.token
96+
*/
97+
public val token: String? = null,
98+
/**
99+
* Commitish value that determines where the Git tag is created from. Can be any branch or
100+
* commit SHA.
101+
*/
102+
public val targetCommitish: String? = null,
103+
/**
104+
* If specified, a discussion of the specified category is created and linked to the release.
105+
* The value must be a category that already exists in the repository. If there is already a
106+
* discussion linked to the release, this parameter is ignored.
107+
*/
108+
public val discussionCategoryName: String? = null,
109+
/**
110+
* Whether to automatically generate the name and body for this release. If name is specified,
111+
* the specified name will be used; otherwise, a name will be automatically generated. If body is
112+
* specified, the body will be pre-pended to the automatically generated notes.
113+
*/
114+
public val generateReleaseNotes: Boolean? = null,
115+
/**
116+
* Append to existing body instead of overwriting it. Default is false.
117+
*/
118+
public val appendBody: Boolean? = null,
119+
/**
120+
* Specifies whether this release should be set as the latest release for the repository. Drafts
121+
* and prereleases cannot be set as latest. Can be `true`, `false`, or `legacy`. Uses GitHub api
122+
* default if not provided
123+
*/
124+
public val makeLatest: ActionGhReleaseV2.MakeLatest? = null,
125+
/**
126+
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
127+
*/
128+
public val _customInputs: Map<String, String> = mapOf(),
129+
/**
130+
* Allows overriding action's version, for example to use a specific minor version, or a newer
131+
* version that the binding doesn't yet know about
132+
*/
133+
public val _customVersion: String? = null,
134+
) : RegularAction<ActionGhReleaseV2.Outputs>("softprops", "action-gh-release", _customVersion ?:
135+
"v2") {
136+
public constructor(
137+
vararg pleaseUseNamedArguments: Unit,
138+
body: String? = null,
139+
bodyPath: String? = null,
140+
name: String? = null,
141+
tagName: String? = null,
142+
draft: Boolean? = null,
143+
prerelease: Boolean? = null,
144+
files: List<String>? = null,
145+
failOnUnmatchedFiles: Boolean? = null,
146+
repository: String? = null,
147+
token: String? = null,
148+
targetCommitish: String? = null,
149+
discussionCategoryName: String? = null,
150+
generateReleaseNotes: Boolean? = null,
151+
appendBody: Boolean? = null,
152+
makeLatest: ActionGhReleaseV2.MakeLatest? = null,
153+
_customInputs: Map<String, String> = mapOf(),
154+
_customVersion: String? = null,
155+
) : this(body=body, bodyPath=bodyPath, name=name, tagName=tagName, draft=draft,
156+
prerelease=prerelease, files=files, failOnUnmatchedFiles=failOnUnmatchedFiles,
157+
repository=repository, token=token, targetCommitish=targetCommitish,
158+
discussionCategoryName=discussionCategoryName,
159+
generateReleaseNotes=generateReleaseNotes, appendBody=appendBody, makeLatest=makeLatest,
160+
_customInputs=_customInputs, _customVersion=_customVersion)
161+
162+
@Suppress("SpreadOperator")
163+
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
164+
*listOfNotNull(
165+
body?.let { "body" to it },
166+
bodyPath?.let { "body_path" to it },
167+
name?.let { "name" to it },
168+
tagName?.let { "tag_name" to it },
169+
draft?.let { "draft" to it.toString() },
170+
prerelease?.let { "prerelease" to it.toString() },
171+
files?.let { "files" to it.joinToString("\n") },
172+
failOnUnmatchedFiles?.let { "fail_on_unmatched_files" to it.toString() },
173+
repository?.let { "repository" to it },
174+
token?.let { "token" to it },
175+
targetCommitish?.let { "target_commitish" to it },
176+
discussionCategoryName?.let { "discussion_category_name" to it },
177+
generateReleaseNotes?.let { "generate_release_notes" to it.toString() },
178+
appendBody?.let { "append_body" to it.toString() },
179+
makeLatest?.let { "make_latest" to it.stringValue },
180+
*_customInputs.toList().toTypedArray(),
181+
).toTypedArray()
182+
)
183+
184+
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
185+
186+
public sealed class MakeLatest(
187+
public val stringValue: String,
188+
) {
189+
public object True : ActionGhReleaseV2.MakeLatest("true")
190+
191+
public object False : ActionGhReleaseV2.MakeLatest("false")
192+
193+
public object Legacy : ActionGhReleaseV2.MakeLatest("legacy")
194+
195+
public class Custom(
196+
customStringValue: String,
197+
) : ActionGhReleaseV2.MakeLatest(customStringValue)
198+
}
199+
200+
public class Outputs(
201+
stepId: String,
202+
) : Action.Outputs(stepId) {
203+
/**
204+
* URL to the Release HTML Page
205+
*/
206+
public val url: String = "steps.$stepId.outputs.url"
207+
208+
/**
209+
* Release ID
210+
*/
211+
public val id: String = "steps.$stepId.outputs.id"
212+
213+
/**
214+
* URL for uploading assets to the release
215+
*/
216+
public val uploadUrl: String = "steps.$stepId.outputs.upload_url"
217+
218+
/**
219+
* JSON array containing information about each uploaded asset, in the format given
220+
* [here](https://docs.github.com/en/rest/reference/repos#upload-a-release-asset--code-samples)
221+
* (minus the `uploader` field)
222+
*/
223+
public val assets: String = "steps.$stepId.outputs.assets"
224+
}
225+
}

0 commit comments

Comments
 (0)