-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
SemverUtilsV2.kt
193 lines (171 loc) · 6.72 KB
/
SemverUtilsV2.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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// 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",
"DEPRECATION",
)
package io.github.typesafegithub.workflows.actions.madhead
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
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: semver-utils
*
* One-stop shop for working with semantic versions in your workflows
*
* [Action on GitHub](https://github.com/madhead/semver-utils)
*
* @param version A version to process
* @param compareTo A version to compare with, if any
* @param satisfies A range to check against
* @param identifier An identifier to pass to the semver's inc function
* @param lenient Do not fail on incorrect input
* @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
*/
@Deprecated(
message = "This action has a newer major version: SemverUtilsV4",
replaceWith = ReplaceWith("SemverUtilsV4"),
)
public data class SemverUtilsV2 private constructor(
/**
* A version to process
*/
public val version: String,
/**
* A version to compare with, if any
*/
public val compareTo: String? = null,
/**
* A range to check against
*/
public val satisfies: String? = null,
/**
* An identifier to pass to the semver's inc function
*/
public val identifier: String? = null,
/**
* Do not fail on incorrect input
*/
public val lenient: Boolean? = 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<SemverUtilsV2.Outputs>("madhead", "semver-utils", _customVersion ?: "v2") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
version: String,
compareTo: String? = null,
satisfies: String? = null,
identifier: String? = null,
lenient: Boolean? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(version=version, compareTo=compareTo, satisfies=satisfies, identifier=identifier,
lenient=lenient, _customInputs=_customInputs, _customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
"version" to version,
compareTo?.let { "compare-to" to it },
satisfies?.let { "satisfies" to it },
identifier?.let { "identifier" to it },
lenient?.let { "lenient" to it.toString() },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* Version's release (major.minor.patch)
*/
public val release: String = "steps.$stepId.outputs.release"
/**
* Version's major number
*/
public val major: String = "steps.$stepId.outputs.major"
/**
* Version's minor number
*/
public val minor: String = "steps.$stepId.outputs.minor"
/**
* Version's patch number
*/
public val patch: String = "steps.$stepId.outputs.patch"
/**
* Version's build
*/
public val build: String = "steps.$stepId.outputs.build"
/**
* Number of components in version's build. Individual сomponents are returned as `build-N`
* outputs, where an is an index from zero to `build-parts` - 1.
*/
public val buildParts: String = "steps.$stepId.outputs.build-parts"
/**
* Version's pre-release
*/
public val prerelease: String = "steps.$stepId.outputs.prerelease"
/**
* Number of components in version's pre-release. Individual сomponents are returned as
* `prerelease-N` outputs, where an is an index from zero to `prerelease-parts` - 1.
*/
public val prereleaseParts: String = "steps.$stepId.outputs.prerelease-parts"
/**
* If the compare-to was provided, this output will contain "<" if comes after the version,
* ">" if it preceeds it, and "=" if they are equal
*/
public val comparisonResult: String = "steps.$stepId.outputs.comparison-result"
/**
* true if the version satisfies the given range
*/
public val satisfies: String = "steps.$stepId.outputs.satisfies"
/**
* A result of the call of the semver's `inc` function with `major` increment
*/
public val incMajor: String = "steps.$stepId.outputs.inc-major"
/**
* A result of the call of the semver's `inc` function with `premajor` increment
*/
public val incPremajor: String = "steps.$stepId.outputs.inc-premajor"
/**
* A result of the call of the semver's `inc` function with `minor` increment
*/
public val incMinor: String = "steps.$stepId.outputs.inc-minor"
/**
* A result of the call of the semver's `inc` function with `preminor` increment
*/
public val incPreminor: String = "steps.$stepId.outputs.inc-preminor"
/**
* A result of the call of the semver's `inc` function with `patch` increment
*/
public val incPatch: String = "steps.$stepId.outputs.inc-patch"
/**
* A result of the call of the semver's `inc` function with `prepatch` increment
*/
public val incPrepatch: String = "steps.$stepId.outputs.inc-prepatch"
/**
* A result of the call of the semver's `inc` function with `prerelease` increment
*/
public val incPrerelease: String = "steps.$stepId.outputs.inc-prerelease"
}
}