name: Upload release assets
on:
  release:
    types: [published]
jobs:
  upload_asset:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v4
      - name: Validate Gradle Wrapper
        uses: gradle/wrapper-validation-action@v2
      - name: Setup Java
        uses: actions/setup-java@v4
        with:
          distribution: temurin
          cache: gradle
          java-version: 17
      - name: Clean Build
        run: ./gradlew clean build --no-daemon
      - name: Upload Release Assets
        uses: AButler/upload-release-assets@v3.0
        with:
          files: 'worldedit-bukkit/build/libs/FastAsyncWorldEdit-Bukkit-*.jar'
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          release-tag: ${{ github.event.release.tag_name }}