chore: linux AppImage and actions/cache (#222)

This commit is contained in:
hstyi
2025-02-14 12:27:14 +08:00
committed by GitHub
parent 045e4f81d6
commit ab2367d670
5 changed files with 80 additions and 2 deletions

View File

@@ -392,6 +392,42 @@ tasks.register("dist") {
throw GradleException("${os.name} is not supported")
}
// AppImage
if (os.isLinux) {
exec {
commandLine(
"wget",
"-O", "appimagetool",
"https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-${if (arch.isArm) "aarch64" else "x86_64"}.AppImage"
)
workingDir = distributionDir.asFile
}
exec {
commandLine("chmod", "+x", distributionDir.file("appimagetool"))
}
val termoraName = project.name.uppercaseFirstChar()
val desktopFile = distributionDir.file(termoraName + File.separator + termoraName + ".desktop").asFile
desktopFile.writeText(
"""[Desktop Entry]
Type=Application
Name=${termoraName}
Exec=bin/${termoraName}
Comment=Terminal emulator and SSH client
Icon=/lib/${termoraName}
Categories=Development;
Terminal=false
""".trimIndent()
)
exec {
commandLine("./appimagetool", termoraName, "${finalFilenameWithoutExtension}.AppImage")
workingDir = distributionDir.asFile
}
}
// sign dmg
if (os.isMacOsX && macOSSign) {