|
| 1 | +#!/usr/bin/env kotlin |
| 2 | + |
| 3 | +@file:Repository("https://repo.maven.apache.org/maven2/") |
| 4 | +@file:DependsOn("io.github.typesafegithub:github-workflows-kt:3.5.0") |
| 5 | + |
| 6 | +@file:Repository("https://bindings.krzeminski.it") |
| 7 | + |
| 8 | +@file:DependsOn("actions:checkout:v4") |
| 9 | +@file:DependsOn("actions:setup-java:v3") |
| 10 | +@file:DependsOn("softprops:action-gh-release:v2.0.6") |
| 11 | +@file:DependsOn("joutvhu:/create-release:v1.0.1") |
| 12 | +@file:DependsOn("gradle:actions__setup-gradle:v3") |
| 13 | +@file:DependsOn("jimeh:update-tags-action:v1.0.1") |
| 14 | + |
| 15 | +import io.github.typesafegithub.workflows.actions.actions.Checkout |
| 16 | +import io.github.typesafegithub.workflows.actions.actions.SetupJava |
| 17 | +import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle |
| 18 | +import io.github.typesafegithub.workflows.actions.jimeh.UpdateTagsAction_Untyped |
| 19 | +import io.github.typesafegithub.workflows.actions.softprops.ActionGhRelease |
| 20 | +import io.github.typesafegithub.workflows.domain.RunnerType |
| 21 | +import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest |
| 22 | +import io.github.typesafegithub.workflows.domain.triggers.Push |
| 23 | +import io.github.typesafegithub.workflows.dsl.expressions.expr |
| 24 | +import io.github.typesafegithub.workflows.dsl.workflow |
| 25 | +import io.github.typesafegithub.workflows.yaml.ConsistencyCheckJobConfig |
| 26 | +import kotlin.script.experimental.jvmhost.JvmScriptEvaluationConfigurationBuilder.Companion.append |
| 27 | + |
| 28 | +workflow( |
| 29 | + name = "build", |
| 30 | + on = listOf( |
| 31 | + Push(branches = listOf("main")) |
| 32 | + ), |
| 33 | + sourceFile = __FILE__, |
| 34 | + consistencyCheckJobConfig = ConsistencyCheckJobConfig.Configuration( |
| 35 | + condition = null, |
| 36 | + env = emptyMap(), |
| 37 | + additionalSteps = { |
| 38 | + |
| 39 | + }, |
| 40 | + useLocalBindingsServerAsFallback = false |
| 41 | + ) |
| 42 | +) { |
| 43 | + job(id = "build_and_package", runsOn = RunnerType.Windows2022) { |
| 44 | + uses(name = "Check out", action = Checkout()) |
| 45 | + |
| 46 | + uses( |
| 47 | + name = "setup jdk", |
| 48 | + action = SetupJava( |
| 49 | + javaPackage = SetupJava.JavaPackage.Jdk, |
| 50 | + javaVersion = "21", |
| 51 | + architecture = "x64", |
| 52 | + distribution = SetupJava.Distribution.Adopt, |
| 53 | + cache = SetupJava.BuildPlatform.Gradle, |
| 54 | + ) |
| 55 | + ) |
| 56 | + |
| 57 | + uses( |
| 58 | + name = "setup gradle", |
| 59 | + action = ActionsSetupGradle() |
| 60 | + ) |
| 61 | + |
| 62 | + run(command = "./gradlew packageDistributable --no-daemon") |
| 63 | + |
| 64 | + uses( |
| 65 | + name = "update tag", |
| 66 | + action = UpdateTagsAction_Untyped( |
| 67 | + tags_Untyped = "nightly" |
| 68 | + ) |
| 69 | + ) |
| 70 | + |
| 71 | + uses( |
| 72 | + name = "create release", |
| 73 | + action = ActionGhRelease( |
| 74 | + body = "Nightly Build", |
| 75 | + draft = false, |
| 76 | + prerelease = true, |
| 77 | + files = listOf( |
| 78 | + "build/obsremote.zip" |
| 79 | + ), |
| 80 | + name = "Nightly", |
| 81 | + tagName = "nightly", |
| 82 | + failOnUnmatchedFiles = true, |
| 83 | +// token = expr { github.token }, |
| 84 | + generateReleaseNotes = true, |
| 85 | +// makeLatest = ActionGhRelease.MakeLatest.True, |
| 86 | + ) |
| 87 | + ) |
| 88 | + } |
| 89 | +} |
| 90 | + |
0 commit comments