diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml new file mode 100644 index 000000000..649225a95 --- /dev/null +++ b/.github/workflows/gradle-publish.yml @@ -0,0 +1,28 @@ +name: Publish package to GitHub Packages + +on: + release: + types: [created] + +jobs: + publish: + runs-on: ubuntu-latest + strategy: + matrix: + java_version: [1.8] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 # 0 indicates all history + - name: Install JDK ${{ matrix.java_version }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java_version }} + - name: Install Android SDK + uses: malinskiy/action-android/install-sdk@release/0.1.0 + - name: Publish sshauthentication-api + run: ./gradlew :sshauthentication-api:publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle b/build.gradle index fce4b4e81..97c8a39bc 100644 --- a/build.gradle +++ b/build.gradle @@ -7,8 +7,6 @@ buildscript { dependencies { // NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information classpath 'com.android.tools.build:gradle:4.1.2' - // bintray dependency to satisfy dependency of openpgp-api lib - classpath 'com.novoda:bintray-release:0.8.0' classpath 'com.squareup.sqldelight:gradle-plugin:0.8.0' } } diff --git a/sshauthentication-api/README.md b/sshauthentication-api/README.md index 9f5ad9d6e..7d6c72a0b 100644 --- a/sshauthentication-api/README.md +++ b/sshauthentication-api/README.md @@ -22,8 +22,3 @@ dependencies { compile 'org.sufficientlysecure:sshauthentication-api:1.0' } ``` - -### Build library -1. Go to root dir of OpenKeychain repo -2. Build: ``./gradlew :sshauthentication-api:assemble`` -2. Release on bintray: ``./gradlew :sshauthentication-api:bintrayUpload -PbintrayUser=sufficientlysecure -PbintrayKey=INSERT-KEY -PdryRun=false`` diff --git a/sshauthentication-api/build.gradle b/sshauthentication-api/build.gradle index 12f3f4681..9c4781de2 100644 --- a/sshauthentication-api/build.gradle +++ b/sshauthentication-api/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'com.android.library' -apply plugin: 'bintray-release' // must be applied after your artifact generating plugin (eg. java / com.android.library) +apply plugin: 'maven-publish' android { if (project.hasProperty('rootProject.ext.compileSdkVersion')) { @@ -12,8 +12,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 28 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "2.0" } // Do not abort build if lint finds errors @@ -22,11 +22,43 @@ android { } } -publish { - userOrg = 'sufficientlysecure' - groupId = 'org.sufficientlysecure' - artifactId = 'sshauthentication-api' - version = '1.0' - description = 'The SSH authentication API library provides an interface to using an external authentication provider, such as OpenKeychain, in the SSH authentication layer.' - website = 'https://github.com/open-keychain/open-keychain' +// https://developer.android.com/studio/build/maven-publish-plugin +afterEvaluate { + publishing { + publications { + release(MavenPublication) { + from components.release + + groupId = 'org.sufficientlysecure' + artifactId = 'sshauthentication-api' + version = android.defaultConfig.versionName + + pom { + url = 'https://github.com/open-keychain' + licenses { + license { + name = 'The Apache Software License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution = 'repo' + } + } + organization { + name = 'Confidential Technologies GmbH' + url = 'https://www.cotech.de' + } + } + } + } + + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/open-keychain/open-keychain" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } + } }