diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..44de254 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Android CI + +on: + push: + branches: [ "core" ] + pull_request: + branches: [ "core" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: set up JDK + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'zulu' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build + - name: Build debug apk + run: bash ./gradlew assembleDebug --stacktrace + diff --git a/app/build.gradle b/app/build.gradle index c24b850..bc012ea 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,20 +3,18 @@ apply plugin: 'kotlin-android' ext.getVersionCode = { base -> try { - def stdout = new ByteArrayOutputStream() - exec { + providers.exec { commandLine 'git', 'rev-list', '--count', base + '..HEAD' - standardOutput(stdout) - } - Integer.parseInt(stdout.toString().trim()) + }.standardOutput.asText.get().toInteger() } catch(ignored) { 10 } } android { - compileSdkVersion 30 - ndkVersion '21.4.7075529' + namespace 'pro.archiemeng.waifu2x' + compileSdkVersion 34 + ndkVersion '25.1.8937393' defaultConfig { applicationId "pro.archiemeng.waifu2x" diff --git a/build.gradle b/build.gradle index eb4d714..0b630f2 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' + classpath 'com.android.tools.build:gradle:8.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d47d36b..2f875df 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip