name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        jdk:
          - 11

    steps:
      - uses: actions/checkout@v2

      - uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
            **/build-cache
            !tmp
          key: v2-${{ runner.os }}-${{ matrix.jdk }}-gradle-${{ hashFiles('**/*.gradle*') }}
          restore-keys: |
            v2-${{ runner.os }}-${{ matrix.jdk }}-gradle-

      - name: Set up JDK ${{ matrix.jdk }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.jdk }}

      - name: Build and test
        uses: eskatos/gradle-command-action@v1
        with:
          arguments: check

      - name: Deploy snapshot
        uses: eskatos/gradle-command-action@v1
        with:
          arguments: uploadSnapshot
        if: >-
          github.event_name == 'push' &&
          github.repository == 'KeepSafe/dexcount-gradle-plugin' &&
          github.ref == 'refs/heads/master'
        env:
          SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
          SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        jdk:
          - 11

    steps:
      - uses: actions/checkout@v2

      - uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
            **/build-cache
            !tmp
          key: v2-${{ runner.os }}-${{ matrix.jdk }}-gradle-${{ hashFiles('**/*.gradle*') }}
          restore-keys: |
            v2-${{ runner.os }}-${{ matrix.jdk }}-gradle-

      - name: Set up JDK ${{ matrix.jdk }}
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.jdk }}

      - name: Build and test
        uses: eskatos/gradle-command-action@v1
        with:
          arguments: check

      - name: Deploy snapshot
        uses: eskatos/gradle-command-action@v1
        with:
          arguments: uploadSnapshot
        if: >-
          github.event_name == 'push' &&
          github.repository == 'KeepSafe/dexcount-gradle-plugin' &&
          github.ref == 'refs/heads/master'
        env:
          ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
          ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}

Update snapshot-upload credential env vars
Update snapshot-upload credential env vars
