diff options
| author | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-11-13 16:04:21 -0800 |
|---|---|---|
| committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-11-13 16:04:21 -0800 |
| commit | 8974b115b69bc25ebf174e8c9637373c4d206325 (patch) | |
| tree | 37eeedfd098827199552987a656596459375e8cc /desktop/build.gradle.kts | |
| parent | 009525bd46edfc77068da212e36f38d410503f2c (diff) | |
| download | rookery-8974b115b69bc25ebf174e8c9637373c4d206325.tar.gz rookery-8974b115b69bc25ebf174e8c9637373c4d206325.zip | |
CI: publish the builds as a download site, deploy via Coolify
The deployed image is now a small nginx site instead of a bare app
tree: the Linux app (with its runtime), a universal jar, the Android
APK, SHA256SUMS and a landing page showing the commit and build date.
- desktop: universalJar bundles the Skiko natives for Linux, macOS and
Windows (Compose's own jar only carries the building OS's).
- Dockerfile: the build stage runs tests and builds every artifact;
site/assemble.sh lays them out; the final stage is nginx:alpine.
- .ci: after the image is built, `main` calls the beta Coolify hook and
`release` the production one; other branches only build.
- .dockerignore keeps local.properties and secrets out of the build.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/build.gradle.kts')
| -rw-r--r-- | desktop/build.gradle.kts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/desktop/build.gradle.kts b/desktop/build.gradle.kts index 2705014..d72a319 100644 --- a/desktop/build.gradle.kts +++ b/desktop/build.gradle.kts @@ -41,3 +41,29 @@ tasks.withType<JavaExec>().configureEach { environment.putAll(System.getenv().filterKeys { it.startsWith("XDG_") || it.startsWith("ROOKERY_") }) standardInput = System.`in` // so `--cube monitor` can take commands } + +// One jar that runs anywhere: the app plus the native graphics libraries for every desktop platform. +// (Compose's own uber jar only carries the natives of the machine that built it.) +val universal: Configuration by configurations.creating { extendsFrom(configurations.runtimeClasspath.get()) } +dependencies { + universal(compose.desktop.linux_x64) + universal(compose.desktop.linux_arm64) + universal(compose.desktop.macos_x64) + universal(compose.desktop.macos_arm64) + universal(compose.desktop.windows_x64) +} + +interface ArchiveServices { @get:javax.inject.Inject val archives: ArchiveOperations } +val archives = objects.newInstance<ArchiveServices>().archives // an injected service, so the configuration cache can store it + +tasks.register<Jar>("universalJar") { + group = "distribution" + archiveBaseName = "rookery" + archiveClassifier = "universal" + manifest { attributes["Main-Class"] = "coffee.liz.rookery.desktop.MainKt" } + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + from(sourceSets.main.get().output) + val unzip = archives // a local, so the closure below captures the service and not the whole build script + from(universal.elements.map { files -> files.filter { it.asFile.name.endsWith(".jar") }.map { unzip.zipTree(it.asFile) } }) + exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "META-INF/INDEX.LIST") +} |
