Skip to content

Commit

Permalink
Add build workflow and update gradle files
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchieMeng committed Feb 23, 2024
1 parent 440d3b4 commit 78c17cc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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

12 changes: 5 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 78c17cc

Please sign in to comment.