Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions .github/workflows/build-1.12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build 1.12 (until1.12.2 Branch)

on:
push:
branches: [ until1.12.2 ]
pull_request:
branches: [ until1.12.2 ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

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

- name: Build with Gradle
run: gradle build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: cocoainput-1.12
path: build/libs/*.jar
104 changes: 104 additions & 0 deletions .github/workflows/build-1.18.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build 1.18 (Master Branch)

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- os: ubuntu-22.04
platform: linux
build_script: build_lib_for_x11.sh
native_deps: build-essential libx11-dev libxtst-dev
gradle_cmd: ./gradlew
build_shell: bash
gradle_shell: bash
- os: macos-13
platform: macos
build_script: build_lib_for_mac.sh
native_deps: ''
gradle_cmd: ./gradlew
build_shell: bash
gradle_shell: bash
- os: windows-2022
platform: windows
build_script: build_lib_for_win.sh
native_deps: ''
gradle_cmd: gradlew.bat
build_shell: msys2 {0}
gradle_shell: cmd

steps:
- uses: actions/checkout@v4

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

- name: Install build dependencies (Linux)
if: matrix.platform == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.native_deps }}

- name: Set up MinGW (Windows)
if: matrix.platform == 'windows'
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
mingw-w64-x86_64-toolchain
make

- name: Build native library (Windows)
if: matrix.platform == 'windows'
shell: ${{ matrix.build_shell }}
run: ./${{ matrix.build_script }}

- name: Build native library (Linux/macOS)
if: matrix.platform != 'windows'
shell: ${{ matrix.build_shell }}
run: chmod +x ${{ matrix.build_script }} && ./${{ matrix.build_script }}

- name: Set executable permissions for gradlew (Linux/macOS)
if: matrix.platform != 'windows'
run: |
chmod +x forge/gradlew
chmod +x fabric/gradlew

- name: Build Forge mod
shell: ${{ matrix.gradle_shell }}
run: |
cd forge
${{ matrix.gradle_cmd }} build --no-daemon

- name: Build Fabric mod
shell: ${{ matrix.gradle_shell }}
run: |
cd fabric
${{ matrix.gradle_cmd }} build --no-daemon

- name: Upload Forge artifacts
uses: actions/upload-artifact@v4
with:
name: forge-mod-${{ matrix.platform }}
path: forge/build/libs/*.jar

- name: Upload Fabric artifacts
uses: actions/upload-artifact@v4
with:
name: fabric-mod-${{ matrix.platform }}
path: fabric/build/libs/*.jar
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


!.gitignore
!.github
!src
!libcocoainput
!README.MD
Expand Down