Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
arkon committed Mar 9, 2024
1 parent 61b3334 commit 2e90b34
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 28 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build app
run: ./gradlew assemble
22 changes: 0 additions & 22 deletions build.gradle

This file was deleted.

8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
}

tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
10 changes: 10 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[plugins]
android-library = { id = "com.android.library", version = "8.3.0" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version = "1.9.23" }

[libraries]
androidx-annotation = { module = "androidx.annotation:annotation", version = "1.7.1" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version = "1.7.0-alpha03" }
androidx-viewpager = { module = "androidx.viewpager:viewpager", version = "1.1.0-alpha01" }

image-decoder = { module = "com.github.tachiyomiorg:image-decoder", version = "e08e9be535" }
7 changes: 7 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
jdk:
- openjdk17
before_install:
- sdk install java 17.0.9-open
- sdk use java 17.0.9-open
install:
- ./gradlew clean :library:assembleRelease :library:publishToMavenLocal
26 changes: 24 additions & 2 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("com.android.library")
kotlin("android")
`maven-publish`
}

android {
Expand All @@ -27,6 +28,27 @@ android {
}

dependencies {
implementation("androidx.annotation:annotation:1.7.1")
implementation("com.github.tachiyomiorg:image-decoder:e08e9be535")
implementation(libs.androidx.annotation)
api(libs.image.decoder)
}

afterEvaluate {
publishing {
publications {
create<MavenPublication>("release") {
groupId = "com.github.tachiyomiorg"
artifactId = "subsampling-scale-image-view"
version = "4.0.0"

from(components["release"])
}
}

repositories {
maven {
name = "jitpack"
url = uri("https://jitpack.io")
}
}
}
}
7 changes: 4 additions & 3 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

defaultConfig {
applicationId = "com.davemorrissey.labs.subscaleview.test"
minSdk = 21
minSdk = 24
targetSdk = 34

versionCode = 4
Expand Down Expand Up @@ -45,6 +45,7 @@ android {

dependencies {
implementation(project(":library"))
implementation("androidx.appcompat:appcompat:1.7.0-alpha03")
implementation("androidx.viewpager:viewpager:1.1.0-alpha01")

implementation(libs.androidx.appcompat)
implementation(libs.androidx.viewpager)
}
3 changes: 2 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ pluginManagement {
}

dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
google()
maven(url = "https://www.jitpack.io")
}
}

Expand Down

0 comments on commit 2e90b34

Please sign in to comment.