|
| 1 | +name: Build TaleListener |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + android_build: |
| 11 | + if: false |
| 12 | + name: Build Android APK |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v3 |
| 16 | + |
| 17 | + - name: Set up JDK 17 |
| 18 | + uses: actions/setup-java@v3 |
| 19 | + with: |
| 20 | + java-version: '17' |
| 21 | + distribution: 'temurin' |
| 22 | + |
| 23 | + - name: Cache Gradle packages |
| 24 | + uses: actions/cache@v3 |
| 25 | + with: |
| 26 | + path: | |
| 27 | + ~/.gradle/caches |
| 28 | + ~/.gradle/wrapper |
| 29 | + key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 30 | + restore-keys: ${{ runner.os }}-${{ runner.arch }}-gradle |
| 31 | + |
| 32 | + - name: Build Android APK |
| 33 | + run: ./gradlew clean assembleDebug |
| 34 | + |
| 35 | + - name: Upload Android Artifact |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: android |
| 39 | + path: composeApp/build/outputs/apk/debug/*.apk |
| 40 | + |
| 41 | + # todo: author and licence unknown; name is shown as org in Discover, name in desktop env is org.overengineer.talelistener https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-native-distribution.html#specifying-distribution-properties |
| 42 | + # todo: crashes on start on kde |
| 43 | + desktop_build_rpm: |
| 44 | + name: Build Desktop RPM |
| 45 | + runs-on: ubuntu-latest |
| 46 | + container: fedora:latest |
| 47 | + |
| 48 | + steps: |
| 49 | + - name: Install dependencies |
| 50 | + run: dnf install -y git rpm-build |
| 51 | + |
| 52 | + - name: Checkout repository |
| 53 | + uses: actions/checkout@v3 |
| 54 | + |
| 55 | + - name: Set up JDK 17 |
| 56 | + uses: actions/setup-java@v3 |
| 57 | + with: |
| 58 | + java-version: '17' |
| 59 | + distribution: 'temurin' |
| 60 | + |
| 61 | + - name: Cache Gradle packages |
| 62 | + uses: actions/cache@v3 |
| 63 | + with: |
| 64 | + path: | |
| 65 | + ~/.gradle/caches |
| 66 | + ~/.gradle/wrapper |
| 67 | + key: ${{ runner.os }}-${{ runner.arch }}-fedora-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 68 | + restore-keys: ${{ runner.os }}-${{ runner.arch }}-fedora-gradle |
| 69 | + |
| 70 | + - name: Build Desktop RPM |
| 71 | + run: ./gradlew clean packageReleaseRpm |
| 72 | + |
| 73 | + - name: Upload Desktop Artifact |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: rpm |
| 77 | + path: composeApp/build/compose/binaries/main-release/rpm/*.rpm |
| 78 | + |
| 79 | + |
| 80 | + desktop_build_deb: |
| 81 | + name: Build Desktop DEB |
| 82 | + runs-on: ubuntu-latest |
| 83 | + steps: |
| 84 | + - uses: actions/checkout@v3 |
| 85 | + |
| 86 | + - name: Set up JDK 17 |
| 87 | + uses: actions/setup-java@v3 |
| 88 | + with: |
| 89 | + java-version: '17' |
| 90 | + distribution: 'temurin' |
| 91 | + |
| 92 | + - name: Cache Gradle packages |
| 93 | + uses: actions/cache@v3 |
| 94 | + with: |
| 95 | + path: | |
| 96 | + ~/.gradle/caches |
| 97 | + ~/.gradle/wrapper |
| 98 | + key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 99 | + restore-keys: ${{ runner.os }}-${{ runner.arch }}-gradle |
| 100 | + |
| 101 | + - name: Build Desktop DEB |
| 102 | + run: ./gradlew clean packageReleaseDeb |
| 103 | + |
| 104 | + - name: Upload Desktop Artifact |
| 105 | + uses: actions/upload-artifact@v4 |
| 106 | + with: |
| 107 | + name: deb |
| 108 | + path: composeApp/build/compose/binaries/main-release/deb/*.deb |
| 109 | + |
| 110 | + desktop_build_appimage: |
| 111 | + name: Build Desktop AppImage |
| 112 | + runs-on: ubuntu-latest |
| 113 | + steps: |
| 114 | + - uses: actions/checkout@v3 |
| 115 | + |
| 116 | + - name: Set up JDK 17 |
| 117 | + uses: actions/setup-java@v3 |
| 118 | + with: |
| 119 | + java-version: '17' |
| 120 | + distribution: 'temurin' |
| 121 | + |
| 122 | + - name: Cache Gradle packages |
| 123 | + uses: actions/cache@v3 |
| 124 | + with: |
| 125 | + path: | |
| 126 | + ~/.gradle/caches |
| 127 | + ~/.gradle/wrapper |
| 128 | + key: ${{ runner.os }}-${{ runner.arch }}-appimage-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 129 | + restore-keys: ${{ runner.os }}-${{ runner.arch }}-appimage-gradle |
| 130 | + |
| 131 | + - name: Build Desktop AppImage |
| 132 | + run: ./gradlew clean packageAppImage |
| 133 | + |
| 134 | + - name: Uber jar |
| 135 | + run: ./gradlew packageReleaseUberJarForCurrentOS |
| 136 | + |
| 137 | + # placeholder icon |
| 138 | + - name: Create AppDir |
| 139 | + run: | |
| 140 | + mkdir -p AppDir/usr/share/metainfo |
| 141 | + cp deploy/linux/appimage/TaleListener.desktop AppDir/ |
| 142 | + cp deploy/linux/appimage/AppRun AppDir/ |
| 143 | + cp composeApp/src/commonMain/composeResources/drawable/audiobook_fallback.png AppDir/org.overengineer.talelistener.png |
| 144 | + chmod +x AppDir/AppRun |
| 145 | +
|
| 146 | + # cp deploy/linux/appimage/TaleListener.appdata.xml AppDir/usr/share/metainfo/ |
| 147 | + |
| 148 | + - name: Copy jar into AppDir |
| 149 | + run: cp composeApp/build/compose/jars/*.jar AppDir/talelistener.jar |
| 150 | + |
| 151 | + - name: Create minimal jre |
| 152 | + run: | |
| 153 | + JRE_DIR=$(dirname $(dirname $(readlink -f $(which java)))) |
| 154 | + jlink --module-path "$JRE_DIR/jmods" \ |
| 155 | + --add-modules java.base,java.desktop,jdk.unsupported,java.logging,java.net.http,java.sql \ |
| 156 | + --strip-debug --compress=2 --no-header-files --no-man-pages --output AppDir/jre |
| 157 | +
|
| 158 | + - name: Run Appimagetool |
| 159 | + run: | |
| 160 | + wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage |
| 161 | + chmod +x appimagetool-x86_64.AppImage |
| 162 | + ./appimagetool-x86_64.AppImage AppDir TaleListener.AppImage |
| 163 | +
|
| 164 | + - name: Upload Desktop Artifact |
| 165 | + uses: actions/upload-artifact@v4 |
| 166 | + with: |
| 167 | + name: AppImage |
| 168 | + path: TaleListener.AppImage |
| 169 | + |
| 170 | + desktop_build_win: |
| 171 | + name: Build Desktop WIN |
| 172 | + runs-on: windows-latest |
| 173 | + steps: |
| 174 | + - uses: actions/checkout@v3 |
| 175 | + |
| 176 | + - name: Set up JDK 17 |
| 177 | + uses: actions/setup-java@v3 |
| 178 | + with: |
| 179 | + java-version: '17' |
| 180 | + distribution: 'temurin' |
| 181 | + |
| 182 | + # |
| 183 | + # - name: Cache Gradle packages |
| 184 | + # uses: actions/cache@v3 |
| 185 | + # with: |
| 186 | + # path: | |
| 187 | + # ~/.gradle/caches |
| 188 | + # ~/.gradle/wrapper |
| 189 | + # key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 190 | + # restore-keys: ${{ runner.os }}-${{ runner.arch }}-gradle |
| 191 | + |
| 192 | + - name: Build Desktop WIN |
| 193 | + run: ./gradlew clean packageReleaseExe |
| 194 | + |
| 195 | + - name: Upload Desktop Artifact |
| 196 | + uses: actions/upload-artifact@v4 |
| 197 | + with: |
| 198 | + name: windows |
| 199 | + path: composeApp/build/compose/binaries/main-release/exe/*.exe |
| 200 | + |
| 201 | + desktop_build_mac_arm: |
| 202 | + name: Build Desktop MAC-ARM |
| 203 | + runs-on: macos-latest |
| 204 | + steps: |
| 205 | + - uses: actions/checkout@v3 |
| 206 | + |
| 207 | + - name: Set up JDK 17 |
| 208 | + uses: actions/setup-java@v3 |
| 209 | + with: |
| 210 | + java-version: '17' |
| 211 | + distribution: 'temurin' |
| 212 | + |
| 213 | + - name: Cache Gradle packages |
| 214 | + uses: actions/cache@v3 |
| 215 | + with: |
| 216 | + path: | |
| 217 | + ~/.gradle/caches |
| 218 | + ~/.gradle/wrapper |
| 219 | + key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 220 | + restore-keys: ${{ runner.os }}-${{ runner.arch }}-gradle |
| 221 | + |
| 222 | + - name: Build Desktop MAC-ARM |
| 223 | + run: ./gradlew clean packageReleaseDmg |
| 224 | + |
| 225 | + - name: Upload Desktop Artifact |
| 226 | + uses: actions/upload-artifact@v4 |
| 227 | + with: |
| 228 | + name: mac-arm-dmg |
| 229 | + path: composeApp/build/compose/binaries/main-release/dmg/*.dmg |
| 230 | + |
| 231 | + |
| 232 | + desktop_build_mac_intel: |
| 233 | + name: Build Desktop MAC-Intel |
| 234 | + runs-on: macos-13 |
| 235 | + steps: |
| 236 | + - uses: actions/checkout@v3 |
| 237 | + |
| 238 | + - name: Set up JDK 17 |
| 239 | + uses: actions/setup-java@v3 |
| 240 | + with: |
| 241 | + java-version: '17' |
| 242 | + distribution: 'temurin' |
| 243 | + |
| 244 | + - name: Cache Gradle packages |
| 245 | + uses: actions/cache@v3 |
| 246 | + with: |
| 247 | + path: | |
| 248 | + ~/.gradle/caches |
| 249 | + ~/.gradle/wrapper |
| 250 | + key: ${{ runner.os }}-${{ runner.arch }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 251 | + restore-keys: ${{ runner.os }}-${{ runner.arch }}-gradle |
| 252 | + |
| 253 | + - name: Build Desktop MAC-ARM |
| 254 | + run: ./gradlew clean packageReleaseDmg |
| 255 | + |
| 256 | + - name: Upload Desktop Artifact |
| 257 | + uses: actions/upload-artifact@v4 |
| 258 | + with: |
| 259 | + name: mac-intel-dmg |
| 260 | + path: composeApp/build/compose/binaries/main-release/dmg/*.dmg |
0 commit comments