ci: publish sshauthentication to GitHub Packages

This commit is contained in:
Dominik Schürmann 2021-03-17 10:11:28 +01:00
parent 5e22f99fe9
commit 5feb191fe1
4 changed files with 70 additions and 17 deletions

28
.github/workflows/gradle-publish.yml vendored Normal file
View file

@ -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 }}

View file

@ -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'
}
}

View file

@ -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``

View file

@ -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")
}
}
}
}
}