<https://github.com/krzema12/github-actions-kotlin...
# github-workflows-kt
p
CC @Nikky, no more need to use the jitpack version 😉
n
maybe add this to the release notes or the documentation as a sample on how to use it..
Copy code
sourceFile = __FILE__.toPath(),
p
n
but maybe mention that you can also do
Copy code
workflow.writeToFile(addConsistencyCheck = true)
instead and just don't need to redirect any outputs..
nevermind seems to not work finding the root.. when i rum the script from the same folder it creates
.github/workflows/
folder..
p
about `addConsistencyCheck`: this is just "getting started" that I'd like to keep simple 🙂 I'm thinking about publishing rendered KDoc or maybe extra recipes how to use the lib
ow, doesn't sound good. If you're able to root-cause the problem, it would be cool. I was testing it on my side and didn't face this issue
could you share the arguments to
workflow
?
n
i tested on windows.. will try on the arch machine too
👍 1
Copy code
#!/usr/bin/env kotlin

@file:DependsOn("it.krzeminski:github-actions-kotlin-dsl:0.18.0")

import it.krzeminski.githubactions.actions.actions.CheckoutV3
import it.krzeminski.githubactions.actions.gradle.GradleBuildActionV2
import it.krzeminski.githubactions.domain.RunnerType.UbuntuLatest
import it.krzeminski.githubactions.domain.triggers.PullRequest
import it.krzeminski.githubactions.domain.triggers.Push
import it.krzeminski.githubactions.dsl.workflow
import it.krzeminski.githubactions.dsl.expr
import it.krzeminski.githubactions.yaml.writeToFile

val workflow = workflow(
    name = "Test gradle",
    on = listOf(
        Push(
            branches = listOf("main"),
        ),
        PullRequest(
            branches = listOf("main"),
        )
    ),
    sourceFile = __FILE__.toPath(),
) {
    job(id = "build_job", name = "Build Job", runsOn = UbuntuLatest) {
        uses(
            name = "Check out",
            action = CheckoutV3(
                fetchDepth = CheckoutV3.FetchDepth.Value(0)
            )
        )
        uses(
            name = "build",
            action = GradleBuildActionV2(
                arguments = "check build --scan"
            )
        )

    }
}

workflow.writeToFile(addConsistencyCheck = true)
p
change version to 0.19.0 🙂
n
oh right.. wait .. what ?
okay nevermind.. i am just too tired ...
i was sure i changed that and then tested in a different copy of the script..
p
no problem 🙂
whenever you have a spare moment, let me know if it works fine on Windows 🙂
n
This problem at least seems to have been fixed.. If any others show up.. I will ofc report or PR..
👍 1