on:
  push:
  workflow_dispatch:
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: '17'
      - shell: bash
        run: ./gradlew lintDebug
      - if: ${{ always() }}
        uses: actions/upload-artifact@v3
        with:
          path: app/build/reports/lint-results-debug.html
  assemble:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: '17'
      - shell: bash
        run: ./gradlew assembleRelease
      - shell: bash
        run: ./gradlew bundleRelease
      - if: startsWith(github.ref, 'refs/tags/v')
        uses: softprops/action-gh-release@v1
        with:
          files: |
            app/build/outputs/apk/release/*-release*.apk
            app/build/outputs/bundle/release/*-release.aab
