Trying nucleus for packaging

Snap stays bespoke
This commit is contained in:
Adam Brown 2026-05-13 23:00:55 -07:00
parent ca5407033d
commit 93c7973cf8
No known key found for this signature in database
3 changed files with 12 additions and 28 deletions

View file

@ -160,7 +160,6 @@ jobs:
:desktop:packageReleaseDeb
:desktop:packageReleaseRpm
:desktop:packageReleaseAppImage
:desktop:packageReleaseSnap
:desktop:packageReleaseFlatpak
- name: Stage Linux artifacts
@ -178,7 +177,7 @@ jobs:
echo "No file matching $name found under $ROOT" >&2; exit 1
fi
}
for pair in "*.deb|hammer.deb" "*.rpm|hammer.rpm" "*.AppImage|hammer.AppImage" "*.snap|hammer.snap" "*.flatpak|hammer.flatpak"; do
for pair in "*.deb|hammer.deb" "*.rpm|hammer.rpm" "*.AppImage|hammer.AppImage" "*.flatpak|hammer.flatpak"; do
glob=${pair%|*}; out=${pair#*|}
src=$(first "$glob"); require "$src" "$glob"
cp "$src" "$STAGE/$out"
@ -194,7 +193,7 @@ jobs:
prerelease: true
artifactErrorsFailBuild: true
allowUpdates: true
artifacts: "${{ github.workspace }}/release-artifacts/hammer.deb,${{ github.workspace }}/release-artifacts/hammer.rpm,${{ github.workspace }}/release-artifacts/hammer.AppImage,${{ github.workspace }}/release-artifacts/hammer.snap,${{ github.workspace }}/release-artifacts/hammer.flatpak"
artifacts: "${{ github.workspace }}/release-artifacts/hammer.deb,${{ github.workspace }}/release-artifacts/hammer.rpm,${{ github.workspace }}/release-artifacts/hammer.AppImage,${{ github.workspace }}/release-artifacts/hammer.flatpak"
macos:
needs: integration-tests

View file

@ -1,4 +1,5 @@
import io.github.kdroidfilter.nucleus.desktop.application.dsl.*
import io.github.kdroidfilter.nucleus.desktop.application.dsl.AppImageCategory
import io.github.kdroidfilter.nucleus.desktop.application.dsl.TargetFormat
val data_version: String by extra
@ -87,8 +88,11 @@ nucleus.application {
TargetFormat.Deb,
TargetFormat.Rpm,
TargetFormat.AppImage,
TargetFormat.Snap, // replaces bespoke snapcraft build
TargetFormat.Flatpak, // replaces bespoke flatpak-builder
// Snap stays on the bespoke snap/snapcraft.yaml path because
// Nucleus derives the snap name from packageName, which would
// rename us from `hammer-editor` to `hammer` on the Snap Store.
// Tracking: https://github.com/NucleusFramework/Nucleus/issues/244
)
includeAllModules = true
packageName = "hammer"
@ -134,25 +138,6 @@ nucleus.application {
desktopEntries = mapOf("Keywords" to "writing;editor;story;novel;")
}
snap {
confinement = SnapConfinement.Strict
grade = SnapGrade.Stable
summary = "A simple tool for building stories"
base = "core22"
compression = SnapCompression.Xz
plugs = listOf(
SnapPlug.Home,
SnapPlug.Network,
SnapPlug.NetworkBind,
SnapPlug.Desktop,
SnapPlug.DesktopLegacy,
SnapPlug.Wayland,
SnapPlug.X11,
SnapPlug.Opengl,
SnapPlug.RemovableMedia,
)
}
flatpak {
runtime = "org.freedesktop.Platform"
runtimeVersion = "24.08"

View file

@ -56,11 +56,11 @@ parts:
# First build all necessary JARs, then create the distributable
./gradlew :desktop:jvmJar --no-daemon
./gradlew :desktop:createDistributable -x desktopTest --no-daemon
# Copy the gradle output to the install directory
# Note: outputBaseDir is set to 'installers' in build.gradle.kts
# This includes the bundled JBR at lib/runtime/
# Copy the gradle output to the install directory.
# Nucleus default outputBaseDir is build/compose/binaries.
# This includes the bundled JBR at lib/runtime/.
mkdir -p $CRAFT_PART_INSTALL/lib
cp -r desktop/build/installers/main/app/hammer $CRAFT_PART_INSTALL/lib/hammer
cp -r desktop/build/compose/binaries/main/app/hammer $CRAFT_PART_INSTALL/lib/hammer
# Create the bin directory and launcher script
# Use the bundled JBR runtime instead of system OpenJDK
mkdir -p $CRAFT_PART_INSTALL/bin