54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: Build Mod
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master", "main", "develop" ]
|
|
pull_request:
|
|
branches: [ "master", "main" ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
cache: gradle
|
|
|
|
- name: Grant execute permission for gradlew
|
|
run: chmod +x gradlew
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v3
|
|
with:
|
|
cache-read-only: false
|
|
gradle-home-cache-cleanup: true
|
|
|
|
- name: Cache Forge resources
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches/forge_gradle
|
|
~/.gradle/caches/minecraft
|
|
key: ${{ runner.os }}-forge-${{ hashFiles('gradle.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-forge-
|
|
|
|
- name: Build with Gradle
|
|
run: ./gradlew build --no-daemon
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: more_spear_enchantments-${{ github.sha }}
|
|
path: build/libs/*.jar
|
|
retention-days: 30
|
|
|