diff --git a/.github/workflows/bindings-server.main.kts b/.github/workflows/bindings-server.main.kts
index 5fb4637cc9..06c44bf381 100755
--- a/.github/workflows/bindings-server.main.kts
+++ b/.github/workflows/bindings-server.main.kts
@@ -99,15 +99,16 @@ workflow(
""".trimIndent(),
)
- cleanMavenLocal()
-
- run(
- name = "Execute the script using the bindings from the server with v2 route",
- command = """
- mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
- .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
- """.trimIndent(),
- )
+ // TODO: Reenable after release, currently, new class "Expression" cannot be found
+ //cleanMavenLocal()
+
+ //run(
+ // name = "Execute the script using the bindings from the server with v2 route",
+ // command = """
+ // mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
+ // .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
+ // """.trimIndent(),
+ //)
cleanMavenLocal()
diff --git a/.github/workflows/bindings-server.yaml b/.github/workflows/bindings-server.yaml
index 9aca42a84a..003494ad4b 100644
--- a/.github/workflows/bindings-server.yaml
+++ b/.github/workflows/bindings-server.yaml
@@ -65,22 +65,14 @@ jobs:
name: 'Clean Maven Local to fetch required POMs again'
run: 'rm -rf ~/.m2/repository/'
- id: 'step-9'
- name: 'Execute the script using the bindings from the server with v2 route'
- run: |-
- mv .github/workflows/test-script-consuming-jit-bindings-v2.main.do-not-compile.kts .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
- .github/workflows/test-script-consuming-jit-bindings-v2.main.kts
- - id: 'step-10'
- name: 'Clean Maven Local to fetch required POMs again'
- run: 'rm -rf ~/.m2/repository/'
- - id: 'step-11'
name: 'Execute the script using bindings but without dependency on library'
run: |-
mv .github/workflows/test-served-bindings-depend-on-library.main.do-not-compile.kts .github/workflows/test-served-bindings-depend-on-library.main.kts
.github/workflows/test-served-bindings-depend-on-library.main.kts
- - id: 'step-12'
+ - id: 'step-10'
name: 'Fetch maven-metadata.xml for top-level action'
run: 'curl --fail http://localhost:8080/actions/checkout/maven-metadata.xml | grep ''v4'''
- - id: 'step-13'
+ - id: 'step-11'
name: 'Fetch maven-metadata.xml for nested action'
run: 'curl --fail http://localhost:8080/actions/cache__save/maven-metadata.xml | grep ''v4'''
deploy:
diff --git a/.github/workflows/end-to-end-tests.main.kts b/.github/workflows/end-to-end-tests.main.kts
index 527ce09694..146d961022 100755
--- a/.github/workflows/end-to-end-tests.main.kts
+++ b/.github/workflows/end-to-end-tests.main.kts
@@ -15,6 +15,7 @@ import io.github.typesafegithub.workflows.actions.actions.*
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle
import io.github.typesafegithub.workflows.actions.wandalen.WretryAction
import io.github.typesafegithub.workflows.annotations.ExperimentalKotlinLogicStep
+import io.github.typesafegithub.workflows.domain.Expression
import io.github.typesafegithub.workflows.domain.JobOutputs
import io.github.typesafegithub.workflows.domain.Mode
import io.github.typesafegithub.workflows.domain.Permission
@@ -81,9 +82,9 @@ workflow(
Permission.Contents to Mode.None,
),
outputs = object : JobOutputs() {
- var scriptKey by output()
- var scriptKey2 by output()
- var scriptResult by output()
+ var scriptKey by output()
+ var scriptKey2 by output()
+ var scriptResult by output()
},
) {
run(
@@ -179,7 +180,7 @@ workflow(
name = "Some step consuming other step's output",
action = Checkout(
sshKey = expr(addAndCommit.outputs.pythonVersion),
- path = expr(addAndCommit.outputs["my-unsafe-output"]),
+ path = addAndCommit.outputs["my-unsafe-output"].expressionString,
),
)
@@ -234,7 +235,7 @@ workflow(
)
jobOutputs.scriptKey = scriptStep.outputs["key"]
jobOutputs.scriptKey2 = scriptStep.outputs["key2"]
- jobOutputs.scriptResult = scriptStep.outputs.result
+ jobOutputs.scriptResult = Expression(scriptStep.outputs.result)
}
job(
@@ -250,9 +251,9 @@ workflow(
run(
name = "use output of script",
command = """
- echo ${expr { testJob1.outputs.scriptKey }}
- echo ${expr { testJob1.outputs.scriptKey2 }}
- echo ${expr { testJob1.outputs.scriptResult }}
+ echo ${testJob1.outputs.scriptKey.expressionString}
+ echo ${expr(testJob1.outputs.scriptKey2.expression)}
+ echo ${expr { testJob1.outputs.scriptResult.expression }}
""".trimIndent(),
)
diff --git a/action-binding-generator/api/action-binding-generator.api b/action-binding-generator/api/action-binding-generator.api
index 0f40016c49..ee3e952422 100644
--- a/action-binding-generator/api/action-binding-generator.api
+++ b/action-binding-generator/api/action-binding-generator.api
@@ -23,6 +23,23 @@ public final class io/github/typesafegithub/workflows/actionbindinggenerator/dom
public static final fun isTopLevel (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;)Z
}
+public final class io/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings {
+ public fun ()V
+ public fun (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;)V
+ public synthetic fun (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
+ public final fun component1 ()Ljava/util/Map;
+ public final fun component2 ()Ljava/util/Map;
+ public final fun component3 ()Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;
+ public final fun copy (Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
+ public static synthetic fun copy$default (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;Ljava/util/Map;Ljava/util/Map;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;ILjava/lang/Object;)Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;
+ public fun equals (Ljava/lang/Object;)Z
+ public final fun getInputTypings ()Ljava/util/Map;
+ public final fun getOutputTypings ()Ljava/util/Map;
+ public final fun getSource ()Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/TypingActualSource;
+ public fun hashCode ()I
+ public fun toString ()Ljava/lang/String;
+}
+
public final class io/github/typesafegithub/workflows/actionbindinggenerator/domain/CommitHash : io/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision {
public fun (Ljava/lang/String;)V
public final fun component1 ()Ljava/lang/String;
@@ -72,8 +89,8 @@ public final class io/github/typesafegithub/workflows/actionbindinggenerator/gen
}
public final class io/github/typesafegithub/workflows/actionbindinggenerator/generation/GenerationKt {
- public static final fun generateBinding (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lkotlin/Pair;)Ljava/util/List;
- public static synthetic fun generateBinding$default (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lkotlin/Pair;ILjava/lang/Object;)Ljava/util/List;
+ public static final fun generateBinding (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;)Ljava/util/List;
+ public static synthetic fun generateBinding$default (Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionCoords;Lio/github/typesafegithub/workflows/actionbindinggenerator/versioning/BindingVersion;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/MetadataRevision;Lio/github/typesafegithub/workflows/actionbindinggenerator/metadata/Metadata;Lio/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings;ILjava/lang/Object;)Ljava/util/List;
}
public final class io/github/typesafegithub/workflows/actionbindinggenerator/metadata/Input {
diff --git a/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings.kt b/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings.kt
new file mode 100644
index 0000000000..cb6dafab99
--- /dev/null
+++ b/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/domain/ActionTypings.kt
@@ -0,0 +1,9 @@
+package io.github.typesafegithub.workflows.actionbindinggenerator.domain
+
+import io.github.typesafegithub.workflows.actionbindinggenerator.typing.Typing
+
+public data class ActionTypings(
+ val inputTypings: Map = emptyMap(),
+ val outputTypings: Map = emptyMap(),
+ val source: TypingActualSource? = null,
+)
diff --git a/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt b/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt
index 9e3baf7b21..3ad22a805b 100644
--- a/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt
+++ b/action-binding-generator/src/main/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/Generation.kt
@@ -12,10 +12,12 @@ import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.plusParameter
import com.squareup.kotlinpoet.PropertySpec
import com.squareup.kotlinpoet.TypeSpec
+import com.squareup.kotlinpoet.WildcardTypeName
import com.squareup.kotlinpoet.asClassName
import com.squareup.kotlinpoet.asTypeName
import com.squareup.kotlinpoet.buildCodeBlock
import io.github.typesafegithub.workflows.actionbindinggenerator.domain.ActionCoords
+import io.github.typesafegithub.workflows.actionbindinggenerator.domain.ActionTypings
import io.github.typesafegithub.workflows.actionbindinggenerator.domain.MetadataRevision
import io.github.typesafegithub.workflows.actionbindinggenerator.domain.TypingActualSource
import io.github.typesafegithub.workflows.actionbindinggenerator.domain.fullName
@@ -28,6 +30,7 @@ import io.github.typesafegithub.workflows.actionbindinggenerator.metadata.Input
import io.github.typesafegithub.workflows.actionbindinggenerator.metadata.Metadata
import io.github.typesafegithub.workflows.actionbindinggenerator.metadata.fetchMetadata
import io.github.typesafegithub.workflows.actionbindinggenerator.metadata.shouldBeRequiredInBinding
+import io.github.typesafegithub.workflows.actionbindinggenerator.typing.ListOfTypings
import io.github.typesafegithub.workflows.actionbindinggenerator.typing.StringTyping
import io.github.typesafegithub.workflows.actionbindinggenerator.typing.Typing
import io.github.typesafegithub.workflows.actionbindinggenerator.typing.asString
@@ -39,6 +42,7 @@ import io.github.typesafegithub.workflows.actionbindinggenerator.utils.toCamelCa
import io.github.typesafegithub.workflows.actionbindinggenerator.utils.toKotlinPackageName
import io.github.typesafegithub.workflows.actionbindinggenerator.versioning.BindingVersion
import io.github.typesafegithub.workflows.actionbindinggenerator.versioning.BindingVersion.V1
+import io.github.typesafegithub.workflows.actionbindinggenerator.versioning.BindingVersion.V2
public data class ActionBinding(
val kotlinCode: String,
@@ -64,12 +68,12 @@ public fun ActionCoords.generateBinding(
bindingVersion: BindingVersion = V1,
metadataRevision: MetadataRevision,
metadata: Metadata? = null,
- inputTypings: Pair