Skip to content

Commit 029ebc0

Browse files
committed
updates and CI
1 parent 1775ae9 commit 029ebc0

27 files changed

+329
-286
lines changed

.github/workflows/build.main.kts

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+

.github/workflows/build.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This file was generated using Kotlin DSL (.github/workflows/build.main.kts).
2+
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
3+
# Generated with https://github.com/typesafegithub/github-workflows-kt
4+
5+
name: 'build'
6+
on:
7+
push:
8+
branches:
9+
- 'main'
10+
jobs:
11+
check_yaml_consistency:
12+
name: 'Check YAML consistency'
13+
runs-on: 'ubuntu-latest'
14+
steps:
15+
- id: 'step-0'
16+
name: 'Check out'
17+
uses: 'actions/checkout@v4'
18+
- id: 'step-1'
19+
name: 'Execute script'
20+
run: 'rm ''.github/workflows/build.yaml'' && ''.github/workflows/build.main.kts'''
21+
- id: 'step-2'
22+
name: 'Consistency check'
23+
run: 'git diff --exit-code ''.github/workflows/build.yaml'''
24+
build_and_package:
25+
runs-on: 'windows-2022'
26+
needs:
27+
- 'check_yaml_consistency'
28+
steps:
29+
- id: 'step-0'
30+
name: 'Check out'
31+
uses: 'actions/checkout@v4'
32+
- id: 'step-1'
33+
name: 'setup jdk'
34+
uses: 'actions/setup-java@v3'
35+
with:
36+
java-version: '21'
37+
distribution: 'adopt'
38+
java-package: 'jdk'
39+
architecture: 'x64'
40+
cache: 'gradle'
41+
- id: 'step-2'
42+
name: 'setup gradle'
43+
uses: 'gradle/actions/setup-gradle@v3'
44+
- id: 'step-3'
45+
run: './gradlew packageDistributable --no-daemon'
46+
- id: 'step-4'
47+
name: 'update tag'
48+
uses: 'jimeh/[email protected]'
49+
with:
50+
tags: 'nightly'
51+
- id: 'step-5'
52+
name: 'create release'
53+
uses: 'softprops/[email protected]'
54+
with:
55+
body: 'Nightly Build'
56+
name: 'Nightly'
57+
tag_name: 'nightly'
58+
draft: 'false'
59+
prerelease: 'true'
60+
files: 'build/obsremote.zip'
61+
fail_on_unmatched_files: 'true'
62+
generate_release_notes: 'true'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ bin/
4444
### Mac OS ###
4545
.DS_Store
4646
.idea/
47+
48+
*.hprof

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# cli-obs-remote
2+

build.gradle.kts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ kotlin {
3434
// }
3535
// }
3636
compilerOptions {
37-
37+
// optIn.add("kotlin.time.ExperimentalTime")
3838
}
3939
// withJava()
4040
@OptIn(ExperimentalKotlinGradlePluginApi::class)
@@ -43,11 +43,14 @@ kotlin {
4343
}
4444
}
4545
mingwX64 {
46+
compilerOptions {
47+
// optIn.add("kotlin.time.ExperimentalTime")
48+
}
4649
binaries {
4750
executable() {
4851
this.baseName = "obsremote"
4952
this.entryPoint = "main"
50-
runTask?.also { runTask ->
53+
runTaskProvider?.orNull?.also { runTask ->
5154
val args = providers.gradleProperty("runArgs")
5255
runTask.argumentProviders.add {
5356
args.orNull?.let { listOf(it) }/*?.split(' ')*/ ?: emptyList()
@@ -78,6 +81,8 @@ kotlin {
7881
implementation("io.github.rejeq:ktobs-ktor:_")
7982

8083
implementation("com.squareup.okio:okio:_")
84+
// implementation("com.saveourtool:okio-extras:_")
85+
implementation("com.saveourtool.okio-extras:okio-extras:_")
8186

8287
implementation("io.github.oshai:kotlin-logging:_")
8388

@@ -154,12 +159,17 @@ tasks.shadowJar {
154159

155160
tasks {
156161
val linkDebugExecutableMingwX64 by getting {}
162+
val linkReleaseExecutableMingwX64 by getting {}
163+
val shadowJar by getting {}
157164

158165
val packageDistributable by registering(Zip::class) {
159166
group = "package"
160167
from(linkDebugExecutableMingwX64)
161-
from(project.file("README.md"))
168+
from(shadowJar)
169+
// from(project.file("README.md"))
162170
archiveBaseName.set(project.name)
171+
archiveVersion.set("")
172+
archiveClassifier.set("")
163173
destinationDirectory.set(project.file("build"))
164174
}
165175
val deployDistributable by registering(Copy::class) {

gradle/wrapper/gradle-wrapper.jar

181 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -205,15 +205,15 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.
212212

213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

gradlew.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
set CLASSPATH=
7474

7575

7676
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
77+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7878

7979
:end
8080
@rem End local scope for the variables with windows NT shell

settings.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ pluginManagement {
1414
plugins {
1515
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
1616
//// # available:"0.10.0"
17+
//// # available:"1.0.0-rc-1"
18+
//// # available:"1.0.0"
1719
// See https://jmfayard.github.io/refreshVersions
1820
id("de.fayard.refreshVersions") version "0.60.5"
1921
}
20-
rootProject.name = "cli-obs-remote"
22+
rootProject.name = "obsremote"
2123

2224
refreshVersions {
2325
this.extraArtifactVersionKeyRules(file("versionKeyRules.txt"))

0 commit comments

Comments
 (0)