fix rules #3971
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file was generated using Kotlin DSL (.github/workflows/src.main.kts). | |
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file. | |
# Generated with https://github.com/typesafegithub/github-workflows-kt | |
name: 'Build' | |
on: | |
push: | |
paths-ignore: | |
- '**/*.md' | |
pull_request: | |
paths-ignore: | |
- '**/*.md' | |
jobs: | |
build: | |
name: '${{ matrix.name }}' | |
runs-on: '${{ matrix.runsOn }}' | |
strategy: | |
fail-fast: false | |
matrix: | |
id: | |
- 'windows-self-hosted' | |
- 'windows-2019' | |
- 'ubuntu-x64' | |
- 'macos-x64' | |
- 'macos-aarch64' | |
include: | |
- arch: 'x64' | |
buildAllAndroidAbis: false | |
buildAnitorrent: true | |
buildAnitorrentSeparately: false | |
buildIosFramework: false | |
composeResourceTriple: 'windows-x64' | |
extraGradleArgs: | |
- '-Pani.android.abis=x86_64' | |
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DBoost_INCLUDE_DIR=C:/vcpkg/installed/x64-windows/include" "-Dorg.gradle.jvmargs=-Xmx6g" "-Dkotlin.daemon.jvm.options=-Xmx6g" "--parallel" "-Pani.android.abis=x86_64"' | |
id: 'windows-self-hosted' | |
installNativeDeps: false | |
name: 'Windows 10 x86_64' | |
os: 'windows' | |
runTests: true | |
runsOn: | |
- 'self-hosted' | |
- 'Windows' | |
- 'X64' | |
selfHosted: true | |
uploadApk: false | |
uploadDesktopInstallers: false | |
- arch: 'x64' | |
buildAllAndroidAbis: false | |
buildAnitorrent: true | |
buildAnitorrentSeparately: false | |
buildIosFramework: false | |
composeResourceTriple: 'windows-x64' | |
extraGradleArgs: | |
- '-Pani.android.abis=x86_64' | |
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DBoost_INCLUDE_DIR=C:/vcpkg/installed/x64-windows/include" "-Dorg.gradle.jvmargs=-Xmx4g" "-Dkotlin.daemon.jvm.options=-Xmx4g" "--parallel" "-Pani.android.abis=x86_64"' | |
id: 'windows-2019' | |
installNativeDeps: true | |
name: 'Windows Server 2019 x86_64' | |
os: 'windows' | |
runTests: true | |
runsOn: | |
- 'windows-2019' | |
selfHosted: false | |
uploadApk: false | |
uploadDesktopInstallers: true | |
- arch: 'x64' | |
buildAllAndroidAbis: true | |
buildAnitorrent: false | |
buildAnitorrentSeparately: false | |
buildIosFramework: false | |
composeResourceTriple: 'linux-x64' | |
extraGradleArgs: [ ] | |
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dorg.gradle.jvmargs=-Xmx4g" "-Dkotlin.daemon.jvm.options=-Xmx4g"' | |
id: 'ubuntu-x64' | |
installNativeDeps: true | |
name: 'Ubuntu x86_64 (Compile only)' | |
os: 'ubuntu' | |
runTests: false | |
runsOn: | |
- 'ubuntu-20.04' | |
selfHosted: false | |
uploadApk: false | |
uploadDesktopInstallers: false | |
- arch: 'x64' | |
buildAllAndroidAbis: true | |
buildAnitorrent: true | |
buildAnitorrentSeparately: true | |
buildIosFramework: false | |
composeResourceTriple: 'macos-x64' | |
extraGradleArgs: [ ] | |
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-Dorg.gradle.jvmargs=-Xmx4g" "-Dkotlin.daemon.jvm.options=-Xmx4g"' | |
id: 'macos-x64' | |
installNativeDeps: true | |
name: 'macOS x86_64' | |
os: 'macos' | |
runTests: true | |
runsOn: | |
- 'macos-13' | |
selfHosted: false | |
uploadApk: true | |
uploadDesktopInstallers: true | |
- arch: 'aarch64' | |
buildAllAndroidAbis: false | |
buildAnitorrent: true | |
buildAnitorrentSeparately: true | |
buildIosFramework: false | |
composeResourceTriple: 'macos-arm64' | |
extraGradleArgs: | |
- '-Pani.android.abis=arm64-v8a' | |
gradleArgs: '"--scan" "--no-configuration-cache" "-Porg.gradle.daemon.idletimeout=60000" "-Pkotlin.native.ignoreDisabledTargets=true" "-Dfile.encoding=UTF-8" "-Dani.enable.anitorrent=true" "-DCMAKE_BUILD_TYPE=Release" "-Dorg.gradle.jvmargs=-Xmx6g" "-Dkotlin.daemon.jvm.options=-Xmx4g" "--parallel" "-Pani.android.abis=arm64-v8a"' | |
id: 'macos-aarch64' | |
installNativeDeps: false | |
name: 'macOS AArch64' | |
os: 'macos' | |
runTests: true | |
runsOn: | |
- 'self-hosted' | |
- 'macOS' | |
- 'ARM64' | |
selfHosted: true | |
uploadApk: true | |
uploadDesktopInstallers: true | |
steps: | |
- id: 'step-0' | |
uses: 'actions/checkout@v4' | |
with: | |
submodules: 'recursive' | |
- id: 'step-1' | |
name: 'Free space for macOS' | |
continue-on-error: true | |
run: 'chmod +x ./ci-helper/free-space-macos.sh && ./ci-helper/free-space-macos.sh' | |
if: '${{ ((matrix.os == ''macos'')) && (!(matrix.selfHosted)) }}' | |
- id: 'step-2' | |
name: 'Resolve JBR location' | |
run: |- | |
# Expand jbrLocationExpr | |
jbr_location_expr=$(eval echo ${{ runner.tool_cache }}/jbrsdk_jcef-21.0.5-osx-aarch64-b631.8.tar.gz) | |
echo "jbrLocation=$jbr_location_expr" >> $GITHUB_OUTPUT | |
if: '${{ ((matrix.os == ''macos'')) && ((matrix.arch == ''aarch64'')) }}' | |
- id: 'step-3' | |
name: 'Get JBR 21 for macOS AArch64' | |
env: | |
jbrLocation: '${{ steps.step-2.outputs.jbrLocation }}' | |
run: |- | |
jbr_location="$jbrLocation" | |
checksum_url="https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_jcef-21.0.5-osx-aarch64-b631.8.tar.gz.checksum" | |
checksum_file="checksum.tmp" | |
wget -q -O $checksum_file $checksum_url | |
expected_checksum=$(awk '{print $1}' $checksum_file) | |
file_checksum="" | |
if [ -f "$jbr_location" ]; then | |
file_checksum=$(shasum -a 512 "$jbr_location" | awk '{print $1}') | |
fi | |
if [ "$file_checksum" != "$expected_checksum" ]; then | |
wget -q --tries=3 https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_jcef-21.0.5-osx-aarch64-b631.8.tar.gz -O "$jbr_location" | |
file_checksum=$(shasum -a 512 "$jbr_location" | awk '{print $1}') | |
fi | |
if [ "$file_checksum" != "$expected_checksum" ]; then | |
echo "Checksum verification failed!" >&2 | |
rm -f $checksum_file | |
exit 1 | |
fi | |
rm -f $checksum_file | |
file "$jbr_location" | |
if: '${{ ((matrix.os == ''macos'')) && ((matrix.arch == ''aarch64'')) }}' | |
- id: 'step-4' | |
name: 'Setup JBR 21 for macOS AArch64' | |
uses: 'gmitch215/setup-java@6d2c5e1f82f180ae79f799f0ed6e3e5efb4e664d' | |
with: | |
java-version: '21' | |
distribution: 'jdkfile' | |
jdkFile: '${{ steps.step-2.outputs.jbrLocation }}' | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
if: '${{ ((matrix.os == ''macos'')) && ((matrix.arch == ''aarch64'')) }}' | |
- id: 'step-5' | |
name: 'Setup JBR 21 for other OS' | |
uses: 'gmitch215/setup-java@6d2c5e1f82f180ae79f799f0ed6e3e5efb4e664d' | |
with: | |
java-version: '21' | |
distribution: 'jetbrains' | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
if: '${{ !(((matrix.os == ''macos'')) && ((matrix.arch == ''aarch64''))) }}' | |
- id: 'step-6' | |
run: 'echo "jvm.toolchain.version=21" >> local.properties' | |
- id: 'step-7' | |
name: 'Setup vcpkg cache' | |
uses: 'actions/github-script@v7' | |
with: | |
script: |- | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
if: '${{ ((matrix.os == ''windows'')) && (matrix.installNativeDeps) }}' | |
- id: 'step-8' | |
name: 'Install Native Dependencies for Windows' | |
env: | |
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' | |
run: './ci-helper/install-deps-windows.cmd' | |
if: '${{ ((matrix.os == ''windows'')) && (matrix.installNativeDeps) }}' | |
- id: 'step-9' | |
name: 'Install Native Dependencies for MacOS' | |
run: 'chmod +x ./ci-helper/install-deps-macos-ci.sh && ./ci-helper/install-deps-macos-ci.sh' | |
if: '${{ ((matrix.os == ''macos'')) && (matrix.installNativeDeps) }}' | |
- id: 'step-10' | |
run: 'chmod -R 777 .' | |
if: '${{ ((matrix.os == ''ubuntu'')) || ((matrix.os == ''macos'')) }}' | |
- id: 'step-11' | |
name: 'Setup Gradle' | |
uses: 'gradle/actions/setup-gradle@v3' | |
with: | |
cache-disabled: 'true' | |
- id: 'step-12' | |
name: 'Clean and download dependencies' | |
uses: 'nick-fields/retry@v2' | |
with: | |
timeout_minutes: '60' | |
max_attempts: '3' | |
command: './gradlew ${{ matrix.gradleArgs }}' | |
- id: 'step-13' | |
name: 'Update dev version name' | |
run: './gradlew updateDevVersionNameFromGit ${{ matrix.gradleArgs }}' | |
- id: 'step-14' | |
name: 'Prepare signing key' | |
continue-on-error: true | |
uses: 'timheuer/base64-to-file@v1.1' | |
with: | |
fileName: 'android_signing_key' | |
fileDir: './' | |
encodedString: '${{ secrets.SIGNING_RELEASE_STOREFILE }}' | |
if: '${{ (github.event_name != ''pull_request'' && github.repository == ''open-ani/animeko'' ) && (matrix.uploadApk) }}' | |
- id: 'step-15' | |
name: 'Build Anitorrent for Desktop' | |
run: './gradlew :torrent:anitorrent:build :torrent:anitorrent:anitorrent-native:buildAnitorrent ${{ matrix.gradleArgs }}' | |
if: '${{ (matrix.buildAnitorrent) && (matrix.buildAnitorrentSeparately) }}' | |
- id: 'step-16' | |
name: 'Build Anitorrent for Android' | |
run: './gradlew :torrent:anitorrent:anitorrent-native:buildAnitorrent buildCMakeDebug buildCMakeRelWithDebInfo ${{ matrix.gradleArgs }}' | |
if: '${{ matrix.buildAnitorrent }}' | |
- id: 'step-17' | |
name: 'Compile Kotlin' | |
run: './gradlew compileKotlin compileCommonMainKotlinMetadata compileDebugKotlinAndroid compileReleaseKotlinAndroid compileJvmMainKotlinMetadata compileKotlinDesktop compileKotlinMetadata ${{ matrix.gradleArgs }}' | |
- id: 'step-18' | |
name: 'Build Android Debug APKs' | |
run: './gradlew assembleDebug ${{ matrix.gradleArgs }}' | |
if: '${{ matrix.uploadApk }}' | |
- id: 'step-19' | |
name: 'Upload Android Debug APK arm64-v8a' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-arm64-v8a-debug' | |
path: 'app/android/build/outputs/apk/debug/android-arm64-v8a-debug.apk' | |
overwrite: 'true' | |
if: '${{ matrix.uploadApk }}' | |
- id: 'step-20' | |
name: 'Upload Android Debug APK x86_64' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-x86_64-debug' | |
path: 'app/android/build/outputs/apk/debug/android-x86_64-debug.apk' | |
overwrite: 'true' | |
if: '${{ matrix.uploadApk }}' | |
- id: 'step-21' | |
name: 'Upload Android Debug APK armeabi-v7a' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-armeabi-v7a-debug' | |
path: 'app/android/build/outputs/apk/debug/android-armeabi-v7a-debug.apk' | |
overwrite: 'true' | |
if: '${{ matrix.uploadApk }}' | |
- id: 'step-22' | |
name: 'Upload Android Debug APK universal' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-universal-debug' | |
path: 'app/android/build/outputs/apk/debug/android-universal-debug.apk' | |
overwrite: 'true' | |
if: '${{ (matrix.uploadApk) && (matrix.buildAllAndroidAbis) }}' | |
- id: 'step-23' | |
name: 'Build Android Release APKs' | |
env: | |
signing_release_storeFileFromRoot: '${{ steps.step-14.outputs.filePath }}' | |
signing_release_storePassword: '${{ secrets.SIGNING_RELEASE_STOREPASSWORD }}' | |
signing_release_keyAlias: '${{ secrets.SIGNING_RELEASE_KEYALIAS }}' | |
signing_release_keyPassword: '${{ secrets.SIGNING_RELEASE_KEYPASSWORD }}' | |
run: './gradlew assembleRelease ${{ matrix.gradleArgs }}' | |
if: '${{ (github.event_name != ''pull_request'' && github.repository == ''open-ani/animeko'' ) && (matrix.uploadApk) }}' | |
- id: 'step-24' | |
name: 'Upload Android Release APK arm64-v8a' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-arm64-v8a-release' | |
path: 'app/android/build/outputs/apk/release/android-arm64-v8a-release.apk' | |
overwrite: 'true' | |
if: '${{ matrix.uploadApk }}' | |
- id: 'step-25' | |
name: 'Upload Android Release APK x86_64' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-x86_64-release' | |
path: 'app/android/build/outputs/apk/release/android-x86_64-release.apk' | |
overwrite: 'true' | |
if: '${{ matrix.uploadApk }}' | |
- id: 'step-26' | |
name: 'Upload Android Release APK armeabi-v7a' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-armeabi-v7a-release' | |
path: 'app/android/build/outputs/apk/release/android-armeabi-v7a-release.apk' | |
overwrite: 'true' | |
if: '${{ matrix.uploadApk }}' | |
- id: 'step-27' | |
name: 'Upload Android Release APK universal' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-android-universal-release' | |
path: 'app/android/build/outputs/apk/release/android-universal-release.apk' | |
overwrite: 'true' | |
if: '${{ (matrix.uploadApk) && (matrix.buildAllAndroidAbis) }}' | |
- id: 'step-28' | |
name: 'Check' | |
uses: 'nick-fields/retry@v2' | |
with: | |
timeout_minutes: '60' | |
max_attempts: '2' | |
command: './gradlew check ${{ matrix.gradleArgs }}' | |
if: '${{ matrix.runTests }}' | |
- id: 'step-29' | |
name: 'Upload Anitorrent CMakeCache.txt' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'anitorrent-cmake-cache-${{ matrix.id }}' | |
path: 'torrent/anitorrent/build-ci/CMakeCache.txt' | |
overwrite: 'true' | |
if: '${{ always() }}' | |
- id: 'step-30' | |
name: 'Upload Anitorrent ${{ matrix.id }}' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'anitorrent-${{ matrix.id }}' | |
path: 'torrent/anitorrent/anitorrent-native/build' | |
overwrite: 'true' | |
if: '${{ always() }}' | |
- id: 'step-31' | |
name: 'Package Desktop' | |
run: './gradlew packageReleaseDistributionForCurrentOS ${{ matrix.gradleArgs }}' | |
if: '${{ (matrix.uploadDesktopInstallers) && (!(((matrix.os == ''macos'')) && ((matrix.arch == ''x64'')))) }}' | |
- id: 'step-32' | |
name: 'Upload compose logs' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'compose-logs-${{ matrix.os }}-${{ matrix.arch }}' | |
path: 'app/desktop/build/compose/logs' | |
if: '${{ matrix.uploadDesktopInstallers }}' | |
- id: 'step-33' | |
name: 'Upload macOS dmg' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-macos-dmg-${{ matrix.arch }}' | |
path: 'app/desktop/build/compose/binaries/main-release/dmg/Ani-*.dmg' | |
overwrite: 'true' | |
if: '${{ (matrix.uploadDesktopInstallers) && ((matrix.os == ''macos'')) }}' | |
- id: 'step-34' | |
name: 'Upload Windows packages' | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: 'ani-windows-portable' | |
path: 'app/desktop/build/compose/binaries/main-release/app' | |
overwrite: 'true' | |
if: '${{ (matrix.uploadDesktopInstallers) && ((matrix.os == ''windows'')) }}' | |
- id: 'step-35' | |
name: 'Cleanup temp files' | |
continue-on-error: true | |
run: 'chmod +x ./ci-helper/cleanup-temp-files-macos.sh && ./ci-helper/cleanup-temp-files-macos.sh' | |
if: '${{ (matrix.selfHosted) && (((matrix.os == ''macos'')) && ((matrix.arch == ''aarch64''))) }}' |