name: Dependencies
on:
  push:
    branches:
      - master # run the action on your projects default branch
    paths-ignore:
      - '**.md'

jobs:
  build:
    name: Dependencies
    runs-on: self-hosted
    permissions: # The Dependency Submission API requires write permission
      contents: write
    steps:
      - name: 'Checkout Repository'
        uses: actions/checkout@v3

      - name: Set up JDK 17
        uses: actions/setup-java@v3
        with:
          java-version: 17
          distribution: 'temurin'

      - name: Setup Android SDK
        uses: android-actions/setup-android@v2

      - name: Setup Gradle
        uses: gradle/gradle-build-action@v2

      - name: Change wrapper permissions
        run: chmod +x ./gradlew

      - name: Run snapshot action
        uses: mikepenz/gradle-dependency-submission@v1
        with:
          gradle-project-path: "."
          gradle-build-module: ":app"