diff --git a/.github/workflows/release_plugin.yml b/.github/workflows/release_plugin.yml index 3701d34..ea7705d 100644 --- a/.github/workflows/release_plugin.yml +++ b/.github/workflows/release_plugin.yml @@ -55,3 +55,15 @@ jobs: secrets: COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} + + publish-android: + needs: release + uses: ./.github/workflows/publish_maven_central.yml + secrets: + ANDROID_CENTRAL_USERNAME: ${{ secrets.ANDROID_CENTRAL_USERNAME }} + ANDROID_CENTRAL_PASSWORD: ${{ secrets.ANDROID_CENTRAL_PASSWORD }} + ANDROID_SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }} + ANDROID_SIGNING_KEY: ${{ secrets.ANDROID_SIGNING_KEY }} + ANDROID_SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }} + ANDROID_SONATYPE_STAGING_PROFILE_ID: ${{ secrets.ANDROID_SONATYPE_STAGING_PROFILE_ID }} + CAP_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }} diff --git a/packages/capacitor-plugin/android/build.gradle b/packages/capacitor-plugin/android/build.gradle index ce3f263..6a647cc 100644 --- a/packages/capacitor-plugin/android/build.gradle +++ b/packages/capacitor-plugin/android/build.gradle @@ -1,4 +1,5 @@ ext { + capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0' @@ -11,15 +12,26 @@ buildscript { repositories { google() mavenCentral() + maven { + url = "https://plugins.gradle.org/m2/" + } } dependencies { classpath 'com.android.tools.build:gradle:8.13.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { + classpath 'io.github.gradle-nexus:publish-plugin:1.3.0' + } } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' +if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { + apply plugin: 'io.github.gradle-nexus.publish-plugin' + apply from: file('../../../scripts/android/publish-root.gradle') + apply from: file('../../../scripts/android/publish-module.gradle') +} android { namespace = "com.capacitorjs.plugins.filesystem" @@ -58,6 +70,13 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) + + if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { + implementation "com.capacitorjs:core:$capacitorVersion" + } else { + implementation project(':capacitor-android') + } + implementation "io.ionic.libs:ionfilesystem-android:1.1.0" implementation project(':capacitor-android') implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"