name: Nebula Nightly

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    runs-on: ubuntu-latest

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

    - name: Setup Gradle
      uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582

    - name: Build
      run: |
            chmod +x gradlew
            ./gradlew jar

    - name: Upload artifact
      uses: actions/upload-artifact@v4
      with:
        name: Nebula-Nightly
        path: Nebula.jar
