diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..91a60c2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,39 @@ +name: Build to Maven Local + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + branches: + - 'master' + tags-ignore: + - '*' + pull_request: + branches: + - 'master' + +jobs: + build: + runs-on: ubuntu-latest + environment: Maven Central + steps: + - uses: actions/checkout@v3 + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + cache: gradle + - name: Set version variable + run: echo "GITHUB_REF_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV + - name: Compile to maven local + env: + VERSION_NAME: ${{ env.GITHUB_REF_NAME }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} + run: bash ./gradlew avifcoillibrary:publishToMavenLocal \ No newline at end of file diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml new file mode 100644 index 0000000..9804e0b --- /dev/null +++ b/.github/workflows/create_release.yml @@ -0,0 +1,35 @@ +name: Create Release + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + environment: Maven Central + steps: + - uses: actions/checkout@v3 + - name: set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + cache: gradle + - name: Set version variable + run: echo "GITHUB_REF_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV + - name: Compile to Maven Central + env: + VERSION_NAME: ${{ env.GITHUB_REF_NAME }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} + PUBLISH_STATE: Release + run: bash ./gradlew avifcoillibrary:publishAllPublicationsToMavenCentralRepository \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f80fbc5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +Bump version, improvements \ No newline at end of file diff --git a/avifcoillibrary/build.gradle.kts b/avifcoillibrary/build.gradle.kts index e7e9e29..a656818 100644 --- a/avifcoillibrary/build.gradle.kts +++ b/avifcoillibrary/build.gradle.kts @@ -1,28 +1,71 @@ +import com.vanniktech.maven.publish.AndroidMultiVariantLibrary + plugins { id("com.android.library") id("org.jetbrains.kotlin.android") id("maven-publish") + id("signing") + id("com.vanniktech.maven.publish") version "0.34.0" } -task("androidSourcesJar", Jar::class) { - archiveClassifier.set("sources") - from(android.sourceSets.getByName("main").java.srcDirs) +mavenPublishing { + if (System.getenv("PUBLISH_STATE") == "Release") { + signAllPublications() + } } -afterEvaluate { - publishing { - publications { - create("mavenJava") { - groupId = "com.github.awxkee" - artifactId = "avif-coder-coil" - version = "2.0.9" - from(components.findByName("release")) -// artifact("androidSourcesJar") +mavenPublishing { + configure( + AndroidMultiVariantLibrary( + sourcesJar = true, + publishJavadocJar = true, + ) + ) + + if (System.getenv("PUBLISH_STATE") == "Release") { + coordinates("io.github.awxkee", "avif-coder-coil", System.getenv("VERSION_NAME") ?: "0.0.10") + } else { + coordinates("io.github.awxkee", "avif-coder-coil", "0.0.10") + } + + pom { + name.set("AVIF Coder Coil") + description.set("AVIF encoder/decoder plugin for coil for Android") + inceptionYear.set("2025") + url.set("https://github.com/awxkee/avif-coder-coil") + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + distribution.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + license { + name.set("The 3-Clause BSD License") + url.set("https://opensource.org/license/bsd-3-clause") + description.set("https://opensource.org/license/bsd-3-clause") + } + } + developers { + developer { + id.set("awxkee") + name.set("Radzivon Bartoshyk") + url.set("https://github.com/awxkee") + email.set("radzivon.bartoshyk@proton.me") } } + scm { + url.set("https://github.com/awxkee/avif-coder-coil") + connection.set("scm:git:git@github.com:awxkee/avif-coder-coil.git") + developerConnection.set("scm:git:ssh://git@github.com/awxkee/avif-coder-coil.git") + } } } +task("androidSourcesJar", Jar::class) { + archiveClassifier.set("sources") + from(android.sourceSets.getByName("main").java.srcDirs) +} + android { publishing { singleVariant("release") { @@ -60,6 +103,6 @@ dependencies { testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - api("io.coil-kt.coil3:coil:3.2.0") + api("io.coil-kt.coil3:coil:3.3.0") api("com.github.awxkee:avif-coder:2.1.4") } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 585bf70..dc85e4a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.10.0-rc04" apply false + id("com.android.application") version "8.12.0" apply false id("org.jetbrains.kotlin.android") version "2.2.0" apply false } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8cae52a..b2f290f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Sep 17 23:53:38 MYT 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists