Skip to content

Commit c7ed15c

Browse files
committed
Submit the Dependency Graph to GitHub
1 parent 1b2cda9 commit c7ed15c

File tree

2 files changed

+154
-0
lines changed

2 files changed

+154
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright 2020-2025 Björn Kautler
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This file was generated using Kotlin DSL (.github/workflows/submit-dependency-graph.main.kts).
16+
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
17+
# Generated with https://github.com/typesafegithub/github-workflows-kt
18+
19+
name: 'Submit Dependency Graph'
20+
on:
21+
push:
22+
branches:
23+
- 'master'
24+
concurrency:
25+
group: '${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}'
26+
cancel-in-progress: true
27+
jobs:
28+
check_yaml_consistency:
29+
name: 'Check YAML consistency'
30+
runs-on: 'ubuntu-latest'
31+
steps:
32+
- id: 'step-0'
33+
name: 'Check out'
34+
uses: 'actions/checkout@v4'
35+
- id: 'step-1'
36+
name: 'Execute script'
37+
run: 'rm ''.github/workflows/submit-dependency-graph.yaml'' && ''.github/workflows/submit-dependency-graph.main.kts'''
38+
- id: 'step-2'
39+
name: 'Consistency check'
40+
run: 'git diff --exit-code ''.github/workflows/submit-dependency-graph.yaml'''
41+
submit_dependency_graph:
42+
name: 'Submit Dependency Graph'
43+
runs-on: 'ubuntu-latest'
44+
needs:
45+
- 'check_yaml_consistency'
46+
steps:
47+
- id: 'step-0'
48+
name: 'Configure Git'
49+
run: 'git config --global core.autocrlf input'
50+
- id: 'step-1'
51+
name: 'Checkout'
52+
uses: 'actions/checkout@v4'
53+
- id: 'step-2'
54+
name: 'Setup Java 11'
55+
uses: 'actions/setup-java@v4'
56+
with:
57+
java-version: '11'
58+
distribution: 'temurin'
59+
- id: 'step-3'
60+
name: 'Submit Dependency Graph'
61+
uses: 'gradle/actions/dependency-submission@v4'
62+
with:
63+
additional-arguments: '--info --stacktrace --show-version'
64+
build-scan-publish: 'true'
65+
build-scan-terms-of-use-url: 'https://gradle.com/help/legal-terms-of-use'
66+
build-scan-terms-of-use-agree: 'yes'

0 commit comments

Comments
 (0)