This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No pinning - on each invocation, | |
// different action's revision may run. | |
@file:DependsOn("actions:checkout:v4") | |
// Pinning to a specific action's commit, | |
// but still different JARs can be used on | |
// each invocation. This is what is done for | |
// YAML-based workflows, and it's enough there. | |
@file:DependsOn("actions:checkout:11bd71901bbe5b1630ceea73d27597364c9af683") // v4.2.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun ActionCoords.buildVersionArtifacts(): Map<String, Artifact>? { | |
val jars = buildJars() ?: return null | |
val pom = buildPomFile() | |
val module = buildModuleFile() | |
return mapOf( | |
"$mavenName-$version.jar" to JarArtifact(jars.mainJar), | |
"$mavenName-$version.jar.md5" to TextArtifact { jars.mainJar().md5Checksum() }, | |
"$mavenName-$version-sources.jar" to JarArtifact(jars.sourcesJar), | |
"$mavenName-$version-sources.jar.md5" to TextArtifact { jars.sourcesJar().md5Checksum() }, | |
"$mavenName-$version.pom" to TextArtifact { pom }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val bindingsCache = | |
Cache | |
.Builder<ActionCoords, Result<Map<String, Artifact>>>() | |
.expireAfterWrite(1.hours) | |
.build() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routing { | |
route("{owner}/{name}/{version}/{file}") { | |
artifact(bindingsCache) | |
} | |
route("{owner}/{name}/{file}") { | |
metadata() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun compileBinding(sourceFilePaths: List<Path>): Path { | |
val compilationOutput = createTempDirectory(prefix = "gwkt-classes_") | |
val args = | |
K2JVMCompilerArguments().apply { | |
destination = compilationOutput.toString() | |
classpath = System.getProperty("java.class.path") | |
freeArgs = sourceFilePaths.map { it.toString() } | |
noStdlib = true | |
noReflect = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@file:Repository("https://some-custom-maven-repo.com/") | |
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.0.1") | |
// /\/\/\/\/\/\/\/\/\/\/\ | /\/\/\/\/\/\ | /\/\ | |
// group ID artifact ID version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [this-branch-must-never-be-created] | |
jobs: | |
some-job: | |
runs-on: ubuntu-latest | |
steps: | |
# List used actions below, as subsequent "- uses" items: | |
- uses: actions/checkout@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- id: 'step-1' | |
name: 'Generate action bindings' | |
run: '.github/workflows/generate-action-bindings.main.kts "build.yaml"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env kotlin | |
@file:DependsOn("io.github.typesafegithub:action-binding-generator:1.5.0") | |
import io.github.typesafegithub.workflows.actionbindinggenerator.generateActionBindings | |
generateActionBindings(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inputs: | |
ssh-strict: | |
type: boolean | |
persist-credentials: | |
type: boolean | |
clean: | |
type: boolean | |
fetch-depth: | |
type: integer | |
named-values: |
NewerOlder