name: Build

on:
  workflow_dispatch:
  push:
    tags:
      - "**"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: recursive
          fetch-depth: 0 # needed for versioning
      - name: Set up Java
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: |
            16
            17
          cache: 'gradle'
      - name: Build with Gradle
        run: ./gradlew clean :BlueMapCore:publish :BlueMapCommon:publish
        env:
          BLUECOLORED_USERNAME: ${{ secrets.BLUECOLORED_USERNAME }}
          BLUECOLORED_PASSWORD: ${{ secrets.BLUECOLORED_PASSWORD }}
