name: Release Fabric
on: workflow_dispatch

jobs:
  release:
    strategy:
      matrix:
        java: [21]
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Validate Gradle wrapper
        uses: gradle/actions/wrapper-validation@v4
      - name: setup jsk ${{ matrix.java }}
        uses: actions/setup-java@v4
        with:
          java-version: ${{ matrix.java }}
          distribution: 'microsoft'
      - name: Build and Publish
        run: ./gradlew fabric:build fabric:modrinth
        env:
          MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
      - name: Capture build artifacts
        uses: actions/upload-artifact@v4
        with:
          name: Artifacts
          path: fabric/build/libs/