Build and deploy a snapshot #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy a snapshot | |
on: | |
push: | |
branches: | |
- master | |
- 'snapshot/*' | |
- 'kotlin-*' | |
paths-ignore: | |
- '**.md' | |
- '**.adoc' | |
- '**/.gitignore' | |
- './github/**' | |
- '!./github/workflow/snapshot.yml' | |
env: | |
SONATYPE_USERNAME: ${{ secrets.sonatype_username }} | |
SONATYPE_PASSWORD: ${{ secrets.sonatype_password }} | |
jobs: | |
build-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
- name: Cached Gradle | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle | |
key: gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
restore-keys: gradle- | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Check | |
run: ./gradlew build check | |
shell: bash | |
- name: Upload | |
run: ./gradlew publishAllPublicationsToOssrhStagingRepository -PgitRef=${{ github.ref }} -Psnapshot=true | |
shell: bash |