name: devbuild

concurrency:
  group: "build-1.20.2"
  cancel-in-progress: true

on:
  push:
    branches: [ master ]
    paths-ignore:
      - '*.md'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Setup JDK 17
      uses: actions/setup-java@v2
      with:
        java-version: 17
        distribution: zulu
    - name: Build
      run: |
        chmod +x ./gradlew
        ./gradlew build
    - name: Remove *-dev.jar
      run: rm ./build/libs/*-dev.jar || true
    - uses: "marvinpinto/action-automatic-releases@latest"
      with:
        repo_token: "${{ secrets.GITHUB_TOKEN }}"
        automatic_release_tag: "latest-1.20.2"
        prerelease: false
        title: "1.20.2 Build"
        files: |
          ./build/libs/*.jar