-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
CreateReleaseV1.kt
152 lines (144 loc) · 5.77 KB
/
CreateReleaseV1.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
// 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: Create a Release
*
* Create a release for a tag in your repository
*
* [Action on GitHub](https://github.com/actions/create-release)
*
* @param tagName The name of the tag. This should come from the webhook payload,
* `github.GITHUB_REF` when a user pushes a new tag
* @param releaseName The name of the release. For example, `Release v1.0.1`
* @param body Text describing the contents of the tag.
* @param bodyPath Path to file with information about the tag.
* @param draft `true` to create a draft (unpublished) release, `false` to create a published one.
* Default: `false`
* @param prerelease `true` to identify the release as a prerelease. `false` to identify the release
* as a full release. Default: `false`
* @param commitish Any branch or commit SHA the Git tag is created from, unused if the Git tag
* already exists. Default: SHA of current commit
* @param owner Owner of the repository if it is not the current one
* @param repo Repository on which to release. Used only if you want to create the release on
* another repo
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
* the binding
* @param _customVersion 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 data class CreateReleaseV1 private constructor(
/**
* The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a
* user pushes a new tag
*/
public val tagName: String,
/**
* The name of the release. For example, `Release v1.0.1`
*/
public val releaseName: String,
/**
* Text describing the contents of the tag.
*/
public val body: String? = null,
/**
* Path to file with information about the tag.
*/
public val bodyPath: String? = null,
/**
* `true` to create a draft (unpublished) release, `false` to create a published one. Default:
* `false`
*/
public val draft: Boolean? = null,
/**
* `true` to identify the release as a prerelease. `false` to identify the release as a full
* release. Default: `false`
*/
public val prerelease: Boolean? = null,
/**
* Any branch or commit SHA the Git tag is created from, unused if the Git tag already exists.
* Default: SHA of current commit
*/
public val commitish: String? = null,
/**
* Owner of the repository if it is not the current one
*/
public val owner: String? = null,
/**
* Repository on which to release. Used only if you want to create the release on another repo
*/
public val repo: 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<CreateReleaseV1.Outputs>("actions", "create-release", _customVersion ?: "v1") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
tagName: String,
releaseName: String,
body: String? = null,
bodyPath: String? = null,
draft: Boolean? = null,
prerelease: Boolean? = null,
commitish: String? = null,
owner: String? = null,
repo: String? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(tagName=tagName, releaseName=releaseName, body=body, bodyPath=bodyPath, draft=draft,
prerelease=prerelease, commitish=commitish, owner=owner, repo=repo,
_customInputs=_customInputs, _customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"tag_name" to tagName,
"release_name" to releaseName,
body?.let { "body" to it },
bodyPath?.let { "body_path" to it },
draft?.let { "draft" to it.toString() },
prerelease?.let { "prerelease" to it.toString() },
commitish?.let { "commitish" to it },
owner?.let { "owner" to it },
repo?.let { "repo" to it },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* The ID of the created Release
*/
public val id: String = "steps.$stepId.outputs.id"
/**
* The URL users can navigate to in order to view the release
*/
public val htmlUrl: String = "steps.$stepId.outputs.html_url"
/**
* The URL for uploading assets to the release
*/
public val uploadUrl: String = "steps.$stepId.outputs.upload_url"
}
}