|  | 
|  | 1 | +#!/usr/bin/env kotlin | 
|  | 2 | + | 
|  | 3 | +/* | 
|  | 4 | + * Copyright 2025 Björn Kautler | 
|  | 5 | + * | 
|  | 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 7 | + * you may not use this file except in compliance with the License. | 
|  | 8 | + * You may obtain a copy of the License at | 
|  | 9 | + * | 
|  | 10 | + *     http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 11 | + * | 
|  | 12 | + * Unless required by applicable law or agreed to in writing, software | 
|  | 13 | + * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 15 | + * See the License for the specific language governing permissions and | 
|  | 16 | + * limitations under the License. | 
|  | 17 | + */ | 
|  | 18 | + | 
|  | 19 | +@file:Import("workflow-with-copyright.main.kts") | 
|  | 20 | + | 
|  | 21 | +@file:Repository("https://repo.maven.apache.org/maven2/") | 
|  | 22 | +// work-around for https://youtrack.jetbrains.com/issue/KT-69145 | 
|  | 23 | +@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.2.0") | 
|  | 24 | + | 
|  | 25 | +@file:Repository("https://bindings.krzeminski.it/") | 
|  | 26 | +@file:DependsOn("actions:checkout___major:[v4,v5-alpha)") | 
|  | 27 | +@file:DependsOn("actions:setup-java___major:[v4,v5-alpha)") | 
|  | 28 | +@file:DependsOn("gradle:actions__dependency-submission___major:[v4,v5-alpha)") | 
|  | 29 | + | 
|  | 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.gradle.ActionsDependencySubmission | 
|  | 34 | +import io.github.typesafegithub.workflows.actions.gradle.ActionsDependencySubmission.BuildScanTermsOfUseAgree.Yes | 
|  | 35 | +import io.github.typesafegithub.workflows.actions.gradle.ActionsDependencySubmission.BuildScanTermsOfUseUrl.HttpsGradleComHelpLegalTermsOfUse | 
|  | 36 | +import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest | 
|  | 37 | +import io.github.typesafegithub.workflows.domain.triggers.Push | 
|  | 38 | + | 
|  | 39 | +// comment in for editability with IntelliSense | 
|  | 40 | +//fun workflowWithCopyright( | 
|  | 41 | +//    name: String, | 
|  | 42 | +//    on: List<io.github.typesafegithub.workflows.domain.triggers.Trigger>, | 
|  | 43 | +//    sourceFile: java.io.File, | 
|  | 44 | +//    block: io.github.typesafegithub.workflows.dsl.WorkflowBuilder.() -> Unit | 
|  | 45 | +//) = Unit | 
|  | 46 | + | 
|  | 47 | +workflowWithCopyright( | 
|  | 48 | +    name = "Submit Dependency Graph", | 
|  | 49 | +    on = listOf( | 
|  | 50 | +        Push(branches = listOf("master")) | 
|  | 51 | +    ), | 
|  | 52 | +    sourceFile = __FILE__ | 
|  | 53 | +) { | 
|  | 54 | +    job( | 
|  | 55 | +        id = "submit_dependency_graph", | 
|  | 56 | +        name = "Submit Dependency Graph", | 
|  | 57 | +        runsOn = UbuntuLatest | 
|  | 58 | +    ) { | 
|  | 59 | +        run( | 
|  | 60 | +            name = "Configure Git", | 
|  | 61 | +            command = "git config --global core.autocrlf input" | 
|  | 62 | +        ) | 
|  | 63 | +        uses( | 
|  | 64 | +            name = "Checkout", | 
|  | 65 | +            action = Checkout() | 
|  | 66 | +        ) | 
|  | 67 | +        uses( | 
|  | 68 | +            name = "Setup Java 11", | 
|  | 69 | +            action = SetupJava( | 
|  | 70 | +                javaVersion = "11", | 
|  | 71 | +                distribution = Temurin | 
|  | 72 | +            ) | 
|  | 73 | +        ) | 
|  | 74 | +        uses( | 
|  | 75 | +            name = "Submit Dependency Graph", | 
|  | 76 | +            action = ActionsDependencySubmission( | 
|  | 77 | +                additionalArguments = listOf( | 
|  | 78 | +                    "--info", | 
|  | 79 | +                    "--stacktrace", | 
|  | 80 | +                    "--show-version" | 
|  | 81 | +                ), | 
|  | 82 | +                buildScanPublish = true, | 
|  | 83 | +                buildScanTermsOfUseUrl = HttpsGradleComHelpLegalTermsOfUse, | 
|  | 84 | +                buildScanTermsOfUseAgree = Yes | 
|  | 85 | +            ) | 
|  | 86 | +        ) | 
|  | 87 | +    } | 
|  | 88 | +} | 
0 commit comments