name: Release Windows and Linux Hydraulic Conveyor

on:
  push:
    tags:
      - 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
  build-and-release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up JDK 21
        uses: actions/setup-java@v4
        with:
          distribution: 'zulu'
          java-version: 21

      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@v4
        with:
          build-scan-publish: true
          build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
          build-scan-terms-of-use-agree: "yes"

      - name: Build jar
        run: ./gradlew createReleaseDistributable

      - name: Run Conveyor
        uses: hydraulic-software/conveyor/actions/build@v16.0
        env:
          TOKEN: ${{ secrets.TOKEN }}
        with:
          command: make copied-site
          signing_key: ${{ secrets.SIGNING_KEY }}
          agree_to_license: 1