11#! / usr/ bin/ env kotlin
22
33/*
4- * Copyright 2020-2023 Björn Kautler
4+ * Copyright 2020-2024 Björn Kautler
55 *
66 * Licensed under the Apache License, Version 2.0 (the "License");
77 * you may not use this file except in compliance with the License.
1717 */
1818
1919@file:Import(" workflow-with-copyright.main.kts" )
20+ @file:Repository(" https://bindings.krzeminski.it/" )
21+ @file:DependsOn(" actions:cache__restore:v4" )
22+ @file:DependsOn(" actions:cache__save:v4" )
23+ @file:DependsOn(" actions:checkout:v4" )
24+ @file:DependsOn(" actions:setup-java:v4" )
25+ @file:DependsOn(" burrunan:gradle-cache-action:v1" )
26+ @file:DependsOn(" Vampire:setup-wsl:v3" )
2027
21- import io.github.typesafegithub.workflows.actions.actions.CacheRestoreV4
22- import io.github.typesafegithub.workflows.actions.actions.CacheSaveV4
23- import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
24- import io.github.typesafegithub.workflows.actions.actions.SetupJavaV4
25- import io.github.typesafegithub.workflows.actions.actions.SetupJavaV4 .Distribution.Temurin
26- import io.github.typesafegithub.workflows.actions.burrunan.GradleCacheActionV1
27- import io.github.typesafegithub.workflows.actions.vampire.SetupWslV3
28- import io.github.typesafegithub.workflows.actions.vampire.SetupWslV3 .Distribution
28+ import io.github.typesafegithub.workflows.actions.actions.CacheRestore
29+ import io.github.typesafegithub.workflows.actions.actions.CacheSave
30+ import io.github.typesafegithub.workflows.actions.actions.Checkout
31+ import io.github.typesafegithub.workflows.actions.actions.SetupJava
32+ import io.github.typesafegithub.workflows.actions.actions.SetupJava .Distribution.Temurin
33+ import io.github.typesafegithub.workflows.actions.burrunan.GradleCacheAction
34+ import io.github.typesafegithub.workflows.actions.vampire.SetupWsl
35+ import io.github.typesafegithub.workflows.actions.vampire.SetupWsl .Distribution
2936import io.github.typesafegithub.workflows.domain.CommandStep
3037import io.github.typesafegithub.workflows.domain.ActionStep
3138import io.github.typesafegithub.workflows.domain.JobOutputs.EMPTY
@@ -129,7 +136,7 @@ val wslBash = Shell.Custom("wsl-bash {0}")
129136
130137val wslSh = Shell .Custom (" wsl-sh {0}" )
131138
132- lateinit var executeActionStep: ActionStep <SetupWslV3 .Outputs >
139+ lateinit var executeActionStep: ActionStep <SetupWsl .Outputs >
133140
134141workflowWithCopyright(
135142 name = " Build and Test" ,
@@ -145,7 +152,7 @@ workflowWithCopyright(
145152 " build/distributions/"
146153 )
147154
148- val executeAction = SetupWslV3 (
155+ val executeAction = SetupWsl (
149156 distribution = Distribution .Custom (expr(" matrix.distribution.user-id" ))
150157 )
151158
@@ -160,18 +167,18 @@ workflowWithCopyright(
160167 )
161168 uses(
162169 name = " Checkout" ,
163- action = CheckoutV4 ()
170+ action = Checkout ()
164171 )
165172 uses(
166173 name = " Setup Java 11" ,
167- action = SetupJavaV4 (
174+ action = SetupJava (
168175 javaVersion = " 11" ,
169176 distribution = Temurin
170177 )
171178 )
172179 uses(
173180 name = " Build" ,
174- action = GradleCacheActionV1 (
181+ action = GradleCacheAction (
175182 arguments = listOf (
176183 " --show-version" ,
177184 " build" ,
@@ -185,7 +192,7 @@ workflowWithCopyright(
185192 )
186193 uses(
187194 name = " Save built artifacts to cache" ,
188- action = CacheSaveV4 (
195+ action = CacheSave (
189196 path = builtArtifacts,
190197 key = expr { github.run_id }
191198 )
@@ -206,7 +213,7 @@ workflowWithCopyright(
206213 ) {
207214 uses(
208215 name = " Restore built artifacts from cache" ,
209- action = CacheRestoreV4 (
216+ action = CacheRestore (
210217 path = builtArtifacts,
211218 key = expr { github.run_id },
212219 failOnCacheMiss = true
@@ -266,7 +273,7 @@ workflowWithCopyright(
266273 )
267274 ) {
268275 executeActionStep = usesSelf(
269- action = SetupWslV3 (
276+ action = SetupWsl (
270277 update = true
271278 )
272279 )
@@ -686,26 +693,26 @@ workflowWithCopyright(
686693 ) {
687694 usesSelf(
688695 name = " Execute action for ${expr(" matrix.distributions.distribution1.user-id" )} " ,
689- action = SetupWslV3 (
696+ action = SetupWsl (
690697 distribution = Distribution .Custom (expr(" matrix.distributions.distribution1.user-id" ))
691698 )
692699 )
693700 usesSelf(
694701 name = " Execute action for ${expr(" matrix.distributions.distribution2.user-id" )} " ,
695- action = SetupWslV3 (
702+ action = SetupWsl (
696703 distribution = Distribution .Custom (expr(" matrix.distributions.distribution2.user-id" ))
697704 )
698705 )
699706 usesSelf(
700707 name = " Execute action for ${expr(" matrix.distributions.distribution3.user-id" )} " ,
701- action = SetupWslV3 (
708+ action = SetupWsl (
702709 distribution = Distribution .Custom (expr(" matrix.distributions.distribution3.user-id" )),
703710 setAsDefault = false
704711 )
705712 )
706713 executeActionStep = usesSelf(
707714 name = " Execute action for ${expr(" matrix.distributions.distribution1.user-id" )} again" ,
708- action = SetupWslV3 (
715+ action = SetupWsl (
709716 distribution = Distribution .Custom (expr(" matrix.distributions.distribution1.user-id" ))
710717 )
711718 )
@@ -783,7 +790,7 @@ workflowWithCopyright(
783790 )
784791 executeActionStep = usesSelfAfterSuccess(
785792 name = " Execute action for ${expr(" matrix.distribution2.user-id" )} " ,
786- action = SetupWslV3 (
793+ action = SetupWsl (
787794 distribution = Distribution .Custom (expr(" matrix.distribution2.user-id" ))
788795 )
789796 )
@@ -842,7 +849,7 @@ workflowWithCopyright(
842849 .associateWith {
843850 usesSelf(
844851 name = " Execute action for ${expr(" matrix.distributions.distribution$it .user-id" )} " ,
845- action = SetupWslV3 (
852+ action = SetupWsl (
846853 distribution = Distribution .Custom (expr(" matrix.distributions.distribution$it .user-id" )),
847854 additionalPackages = if (it == 2 ) listOf (" bash" ) else null ,
848855 setAsDefault = if (it >= 3 ) false else null
@@ -934,7 +941,7 @@ fun JobBuilder<*>.commonTests() {
934941
935942fun JobBuilder <* >.usesSelfAfterSuccess (
936943 name : String = "Execute action",
937- action : SetupWslV3
944+ action : SetupWsl
938945) = usesSelf(
939946 name = name,
940947 action = action,
@@ -943,7 +950,7 @@ fun JobBuilder<*>.usesSelfAfterSuccess(
943950
944951fun JobBuilder <* >.usesSelf (
945952 name : String = "Execute action",
946- action : SetupWslV3 ,
953+ action : SetupWsl ,
947954 condition : String? = null,
948955 continueOnError : Boolean? = null
949956) = uses(
0 commit comments