mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
chore: linux AppImage and actions/cache (#222)
This commit is contained in:
18
.github/workflows/linux-x86-64.yml
vendored
18
.github/workflows/linux-x86-64.yml
vendored
@@ -4,7 +4,7 @@ on: [ push, pull_request ]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -13,6 +13,9 @@ jobs:
|
|||||||
# download jdk
|
# 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
|
- 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
|
# install jdk
|
||||||
- name: Installing Java
|
- name: Installing Java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
@@ -22,6 +25,15 @@ jobs:
|
|||||||
java-version: '21.0.6'
|
java-version: '21.0.6'
|
||||||
architecture: x64
|
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
|
# dist
|
||||||
- run: |
|
- run: |
|
||||||
./gradlew dist --no-daemon
|
./gradlew dist --no-daemon
|
||||||
@@ -30,4 +42,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: termora-linux-x86-64
|
name: termora-linux-x86-64
|
||||||
path: build/distributions/*.tar.gz
|
path: |
|
||||||
|
build/distributions/*.tar.gz
|
||||||
|
build/distributions/*.AppImage
|
||||||
|
|||||||
9
.github/workflows/osx-aarch64.yml
vendored
9
.github/workflows/osx-aarch64.yml
vendored
@@ -45,6 +45,15 @@ jobs:
|
|||||||
java-version: '21.0.6'
|
java-version: '21.0.6'
|
||||||
architecture: aarch64
|
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
|
# dist
|
||||||
- name: Dist
|
- name: Dist
|
||||||
env:
|
env:
|
||||||
|
|||||||
10
.github/workflows/osx-x86-64.yml
vendored
10
.github/workflows/osx-x86-64.yml
vendored
@@ -46,6 +46,16 @@ jobs:
|
|||||||
architecture: x64
|
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
|
# dist
|
||||||
- name: Dist
|
- name: Dist
|
||||||
env:
|
env:
|
||||||
|
|||||||
9
.github/workflows/windows-x86-64.yml
vendored
9
.github/workflows/windows-x86-64.yml
vendored
@@ -16,6 +16,15 @@ jobs:
|
|||||||
distribution: 'jetbrains'
|
distribution: 'jetbrains'
|
||||||
java-version: '21'
|
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
|
# dist
|
||||||
- run: |
|
- run: |
|
||||||
.\gradlew.bat dist --no-daemon
|
.\gradlew.bat dist --no-daemon
|
||||||
|
|||||||
@@ -392,6 +392,42 @@ tasks.register("dist") {
|
|||||||
throw GradleException("${os.name} is not supported")
|
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
|
// sign dmg
|
||||||
if (os.isMacOsX && macOSSign) {
|
if (os.isMacOsX && macOSSign) {
|
||||||
|
|||||||
Reference in New Issue
Block a user