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

@@ -4,7 +4,7 @@ on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
@@ -13,6 +13,9 @@ jobs:
# download jdk
- run: wget -O $RUNNER_TEMP/java_package.tar.gz https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk-21.0.6-linux-x64-b825.69.tar.gz
# appimagetool
- run: sudo apt install libfuse2
# install jdk
- name: Installing Java
uses: actions/setup-java@v4
@@ -22,6 +25,15 @@ jobs:
java-version: '21.0.6'
architecture: x64
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-gradle-
# dist
- run: |
./gradlew dist --no-daemon
@@ -30,4 +42,6 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: termora-linux-x86-64
path: build/distributions/*.tar.gz
path: |
build/distributions/*.tar.gz
build/distributions/*.AppImage

View File

@@ -45,6 +45,15 @@ jobs:
java-version: '21.0.6'
architecture: aarch64
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-gradle-
# dist
- name: Dist
env:

View File

@@ -46,6 +46,16 @@ jobs:
architecture: x64
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-gradle-
# dist
- name: Dist
env:

View File

@@ -16,6 +16,15 @@ jobs:
distribution: 'jetbrains'
java-version: '21'
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-gradle-
# dist
- run: |
.\gradlew.bat dist --no-daemon

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) {