Skip to content

Add Sonatype publications to CI #5

Add Sonatype publications to CI

Add Sonatype publications to CI #5

name: Sonatype publication with Gradle
on:
release:
types: [released]
# Run on pull requests
pull_request:
jobs:
sonatype-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
#Run JDK configuration
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
#Gradle cache configuration
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
#Authorizing gradlew files
- name: Grant execute permission for gradlew
run: chmod +x gradlew
#Build project
- name: Build with Gradle
run: ./gradlew build
#Publish project
- name: Publish DeviceSDK
run: ./gradlew DeviceSDK:build |
DeviceSDKAndroid:build |
DeviceSDKGeneric:build
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}