Skip to content

Commit

Permalink
create ci
Browse files Browse the repository at this point in the history
  • Loading branch information
anweisen committed Oct 13, 2024
1 parent f8f83f9 commit 314e49a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build
on: [pull_request, push]

jobs:
build:
strategy:
matrix:
java: [
21 # Minimum supported by Minecraft
]
os: [ubuntu-20.04, windows-latest]
mod_loader: [fabric, forge, neoforge] # Add loaders to matrix
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Make gradle wrapper executable (Linux only)
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew

- name: Build Common Module
run: ./gradlew :common:build

# Build for specific mod loader based on matrix
- name: Build ${{ matrix.mod_loader }} Loader
run: ./gradlew :${{ matrix.mod_loader }}:build

- name: Capture Build Artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only on Linux and latest Java
uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.mod_loader }}
path: ${{ matrix.mod_loader }}/build/libs/

0 comments on commit 314e49a

Please sign in to comment.