Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 46 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,51 @@
name: Build
name: Java CI with Gradle

on: [ pull_request, push, workflow_dispatch ]
on:
push:
branches: [ "1.16.5" ]
pull_request:
branches: [ "1.16.5" ]
workflow_dispatch:

jobs:
Build:
runs-on: ubuntu-22.04
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew build
- name: Upload artifacts (fabric)
uses: actions/upload-artifact@v3
with:
name: fabric
path: ${{ github.workspace }}/fabric/build/libs
- name: Upload artifacts (forge)
uses: actions/upload-artifact@v3
with:
name: forge
path: ${{ github.workspace }}/forge/build/libs
- uses: actions/checkout@v4

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

- name: Cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}

- name: Build with Gradle Wrapper
run: |
chmod +x gradlew
./gradlew build

- name: Upload artifacts (fabric)
uses: actions/upload-artifact@v4
with:
name: fabric
path: ${{ github.workspace }}/fabric/build/libs

- name: Upload artifacts (forge)
uses: actions/upload-artifact@v4
with:
name: forge
path: ${{ github.workspace }}/forge/build/libs