diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f57f0ad --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Build and Upload Artifacts + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + name: Build Fabric Mod + runs-on: ubuntu-latest + + steps: + # Checkout the repository + - name: Checkout repository + uses: actions/checkout@v3 + + # Set up JDK 21 for fabric mod development + - name: Set up JDK 21 + uses: actions/setup-java@v3 + with: + java-version: '21' + distribution: 'temurin' + + # Cache Gradle dependencies + - name: Cache Gradle dependencies + uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + # Build the mod + - name: Build the mod + run: ./gradlew build + + # Upload build artifacts + - name: Upload build artifacts + uses: actions/upload-artifact@v4.6.2 + with: + name: fabric-mod-build + path: build/libs/*.jar