name: Create APK from Master

on:
  workflow_dispatch:
  push:
    branches:
    - master
    paths-ignore:
      - 'fastlane/**'
      - '.github/**'
      - 'icons/**'
      - 'images/**'
      - 'scripts/**'
      - 'whatsnew/**'
      - '**.md'
      - '**.MD'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
  
    - name: Setting up project
      uses: ./.github/actions/setup
      
    - name: Build APK ⚙️🛠
      run: bash ./gradlew assembleDebug
    

    - uses: "marvinpinto/action-automatic-releases@latest"
      with:
          repo_token: "${{ github.token }}"
          automatic_release_tag: "latest-master"
          prerelease: true
          title: "Staging Build"
          files: app/build/outputs/apk/debug/*.apk
