Skip to content

Commit

Permalink
feat(actions): add madhead/semver-utils@v4
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 committed Feb 5, 2024
1 parent 30f859e commit 2340366
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 4 deletions.
Empty file.
1 change: 1 addition & 0 deletions actions/madhead/semver-utils/v4/commit-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
40bbdc6e50b258c09f35f574e83c51f60d2ce3a2
4 changes: 2 additions & 2 deletions docs/supported-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Click on a version to see the binding's code.
* madhead
* [check-gradle-version](https://github.com/madhead/check-gradle-version) - v1 ✅: [`CheckGradleVersionV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/CheckGradleVersionV1.kt)
* [intellij-http-client-action](https://github.com/madhead/intellij-http-client-action) - v0 ✅: [`IntellijHttpClientActionV0`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/IntellijHttpClientActionV0.kt), v231 ✅: [`IntellijHttpClientActionV231`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/IntellijHttpClientActionV231.kt), v233 ✅: [`IntellijHttpClientActionV233`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/IntellijHttpClientActionV233.kt)
* [semver-utils](https://github.com/madhead/semver-utils) - v2 ✅: [`SemverUtilsV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/SemverUtilsV2.kt), v3 ✅: [`SemverUtilsV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/SemverUtilsV3.kt)
* [semver-utils](https://github.com/madhead/semver-utils) - v2 ✅: [`SemverUtilsV2`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/SemverUtilsV2.kt), v3 ✅: [`SemverUtilsV3`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/SemverUtilsV3.kt), v4 ✅: [`SemverUtilsV4`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/madhead/SemverUtilsV4.kt)
* mi-kas
* [kover-report](https://github.com/mi-kas/kover-report) - v1 ✅: [`KoverReportV1`](https://github.com/typesafegithub/github-workflows-kt/blob/v[[ version ]]/github-workflows-kt/src/gen/kotlin/io/github/typesafegithub/workflows/actions/mikas/KoverReportV1.kt)
* microsoft
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: 152
* counting each version separately: 153

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 @@ -39,8 +39,8 @@ import kotlin.collections.toTypedArray
* version, or a newer version that the binding doesn't yet know about
*/
@Deprecated(
message = "This action has a newer major version: SemverUtilsV3",
replaceWith = ReplaceWith("SemverUtilsV3"),
message = "This action has a newer major version: SemverUtilsV4",
replaceWith = ReplaceWith("SemverUtilsV4"),
)
public data class SemverUtilsV2 private constructor(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
"DEPRECATION",
)

package io.github.typesafegithub.workflows.actions.madhead
Expand All @@ -12,6 +13,7 @@ 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
Expand All @@ -38,6 +40,10 @@ import kotlin.collections.toTypedArray
* @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 SemverUtilsV3 private constructor(
/**
* A version to process
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
// 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.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.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 diffWith A version to diff with. If not specified, the version will be diffed with the
* `compare-to` input. If `compare-to` is not specified either, nothing happens.
* @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
*/
public data class SemverUtilsV4 private constructor(
/**
* A version to process
*/
public val version: String,
/**
* A version to compare with, if any
*/
public val compareTo: String? = null,
/**
* A version to diff with. If not specified, the version will be diffed with the `compare-to`
* input. If `compare-to` is not specified either, nothing happens.
*/
public val diffWith: 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<SemverUtilsV4.Outputs>("madhead", "semver-utils", _customVersion ?: "v4") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
version: String,
compareTo: String? = null,
diffWith: String? = null,
satisfies: String? = null,
identifier: String? = null,
lenient: Boolean? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(version=version, compareTo=compareTo, diffWith=diffWith, 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 },
diffWith?.let { "diff-with" 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"

/**
* If the diff-to or compare-to were provided, this output will contain the diff result
*/
public val diffResult: String = "steps.$stepId.outputs.diff-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"
}
}

0 comments on commit 2340366

Please sign in to comment.