-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(abg): allow usage of version ranges by generating only major or …
…minor version even with more detailed version
- Loading branch information
Showing
15 changed files
with
441 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...in/io/github/typesafegithub/workflows/actionbindinggenerator/domain/SignificantVersion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.github.typesafegithub.workflows.actionbindinggenerator.domain | ||
|
||
public enum class SignificantVersion { | ||
MAJOR, | ||
MINOR, | ||
FULL, | ||
; | ||
|
||
override fun toString(): String = super.toString().lowercase() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...kflows/actionbindinggenerator/bindingsfromunittests/ActionWithNoInputsWithMajorVersion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// 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.johnsmith | ||
|
||
import io.github.typesafegithub.workflows.domain.actions.Action | ||
import io.github.typesafegithub.workflows.domain.actions.RegularAction | ||
import java.util.LinkedHashMap | ||
import kotlin.ExposedCopyVisibility | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import kotlin.Unit | ||
import kotlin.collections.Map | ||
|
||
/** | ||
* Action: Action With No Inputs | ||
* | ||
* Description | ||
* | ||
* [Action on GitHub](https://github.com/john-smith/action-with-no-inputs-with-major-version) | ||
* | ||
* @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 | ||
*/ | ||
@ExposedCopyVisibility | ||
public data class ActionWithNoInputsWithMajorVersion private constructor( | ||
/** | ||
* 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<Action.Outputs>("john-smith", "action-with-no-inputs-with-major-version", | ||
_customVersion ?: "v3") { | ||
public constructor( | ||
vararg pleaseUseNamedArguments: Unit, | ||
_customInputs: Map<String, String> = mapOf(), | ||
_customVersion: String? = null, | ||
) : this(_customInputs = _customInputs, _customVersion = _customVersion) | ||
|
||
@Suppress("SpreadOperator") | ||
override fun toYamlArguments(): LinkedHashMap<String, String> = LinkedHashMap(_customInputs) | ||
|
||
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId) | ||
} |
80 changes: 80 additions & 0 deletions
80
...ctionbindinggenerator/bindingsfromunittests/ActionWithNoInputsWithMajorVersion_Untyped.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// 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.johnsmith | ||
|
||
import io.github.typesafegithub.workflows.domain.actions.Action | ||
import io.github.typesafegithub.workflows.domain.actions.RegularAction | ||
import java.util.LinkedHashMap | ||
import kotlin.Deprecated | ||
import kotlin.ExposedCopyVisibility | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import kotlin.Unit | ||
import kotlin.collections.Map | ||
|
||
/** | ||
* ```text | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* !!! WARNING !!! | ||
* !!! !!! | ||
* !!! This action binding has no typings provided. All inputs will !!! | ||
* !!! have a default type of String. !!! | ||
* !!! To be able to use this action in a type-safe way, ask the !!! | ||
* !!! action's owner to provide the typings using !!! | ||
* !!! !!! | ||
* !!! https://github.com/typesafegithub/github-actions-typing !!! | ||
* !!! !!! | ||
* !!! or if it's impossible, contribute typings to a community-driven !!! | ||
* !!! !!! | ||
* !!! https://github.com/typesafegithub/github-actions-typing-catalog !!! | ||
* !!! !!! | ||
* !!! This '_Untyped' binding will be available even once the typings !!! | ||
* !!! are added. !!! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ``` | ||
* | ||
* Action: Action With No Inputs | ||
* | ||
* Description | ||
* | ||
* [Action on GitHub](https://github.com/john-smith/action-with-no-inputs-with-major-version) | ||
* | ||
* @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( | ||
"Use the typed class instead", | ||
ReplaceWith("ActionWithNoInputsWithMajorVersion"), | ||
) | ||
@ExposedCopyVisibility | ||
public data class ActionWithNoInputsWithMajorVersion_Untyped private constructor( | ||
/** | ||
* 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<Action.Outputs>("john-smith", "action-with-no-inputs-with-major-version", | ||
_customVersion ?: "v3") { | ||
public constructor( | ||
vararg pleaseUseNamedArguments: Unit, | ||
_customInputs: Map<String, String> = mapOf(), | ||
_customVersion: String? = null, | ||
) : this(_customInputs = _customInputs, _customVersion = _customVersion) | ||
|
||
@Suppress("SpreadOperator") | ||
override fun toYamlArguments(): LinkedHashMap<String, String> = LinkedHashMap(_customInputs) | ||
|
||
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId) | ||
} |
55 changes: 55 additions & 0 deletions
55
...kflows/actionbindinggenerator/bindingsfromunittests/ActionWithNoInputsWithMinorVersion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// 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.johnsmith | ||
|
||
import io.github.typesafegithub.workflows.domain.actions.Action | ||
import io.github.typesafegithub.workflows.domain.actions.RegularAction | ||
import java.util.LinkedHashMap | ||
import kotlin.ExposedCopyVisibility | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import kotlin.Unit | ||
import kotlin.collections.Map | ||
|
||
/** | ||
* Action: Action With No Inputs | ||
* | ||
* Description | ||
* | ||
* [Action on GitHub](https://github.com/john-smith/action-with-no-inputs-with-minor-version) | ||
* | ||
* @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 | ||
*/ | ||
@ExposedCopyVisibility | ||
public data class ActionWithNoInputsWithMinorVersion private constructor( | ||
/** | ||
* 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<Action.Outputs>("john-smith", "action-with-no-inputs-with-minor-version", | ||
_customVersion ?: "v3.1") { | ||
public constructor( | ||
vararg pleaseUseNamedArguments: Unit, | ||
_customInputs: Map<String, String> = mapOf(), | ||
_customVersion: String? = null, | ||
) : this(_customInputs = _customInputs, _customVersion = _customVersion) | ||
|
||
@Suppress("SpreadOperator") | ||
override fun toYamlArguments(): LinkedHashMap<String, String> = LinkedHashMap(_customInputs) | ||
|
||
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId) | ||
} |
80 changes: 80 additions & 0 deletions
80
...ctionbindinggenerator/bindingsfromunittests/ActionWithNoInputsWithMinorVersion_Untyped.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// 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.johnsmith | ||
|
||
import io.github.typesafegithub.workflows.domain.actions.Action | ||
import io.github.typesafegithub.workflows.domain.actions.RegularAction | ||
import java.util.LinkedHashMap | ||
import kotlin.Deprecated | ||
import kotlin.ExposedCopyVisibility | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import kotlin.Unit | ||
import kotlin.collections.Map | ||
|
||
/** | ||
* ```text | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* !!! WARNING !!! | ||
* !!! !!! | ||
* !!! This action binding has no typings provided. All inputs will !!! | ||
* !!! have a default type of String. !!! | ||
* !!! To be able to use this action in a type-safe way, ask the !!! | ||
* !!! action's owner to provide the typings using !!! | ||
* !!! !!! | ||
* !!! https://github.com/typesafegithub/github-actions-typing !!! | ||
* !!! !!! | ||
* !!! or if it's impossible, contribute typings to a community-driven !!! | ||
* !!! !!! | ||
* !!! https://github.com/typesafegithub/github-actions-typing-catalog !!! | ||
* !!! !!! | ||
* !!! This '_Untyped' binding will be available even once the typings !!! | ||
* !!! are added. !!! | ||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
* ``` | ||
* | ||
* Action: Action With No Inputs | ||
* | ||
* Description | ||
* | ||
* [Action on GitHub](https://github.com/john-smith/action-with-no-inputs-with-minor-version) | ||
* | ||
* @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( | ||
"Use the typed class instead", | ||
ReplaceWith("ActionWithNoInputsWithMinorVersion"), | ||
) | ||
@ExposedCopyVisibility | ||
public data class ActionWithNoInputsWithMinorVersion_Untyped private constructor( | ||
/** | ||
* 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<Action.Outputs>("john-smith", "action-with-no-inputs-with-minor-version", | ||
_customVersion ?: "v3.1") { | ||
public constructor( | ||
vararg pleaseUseNamedArguments: Unit, | ||
_customInputs: Map<String, String> = mapOf(), | ||
_customVersion: String? = null, | ||
) : this(_customInputs = _customInputs, _customVersion = _customVersion) | ||
|
||
@Suppress("SpreadOperator") | ||
override fun toYamlArguments(): LinkedHashMap<String, String> = LinkedHashMap(_customInputs) | ||
|
||
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId) | ||
} |
Oops, something went wrong.