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
28 changes: 28 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Setup Environment
description: Setup JDK and Gradle

inputs:
update-cache:
description: If cache should be updated
required: false
default: 'false'

runs:
using: composite
steps:
- name: Setup JDK
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-write-only: ${{ inputs.update-cache }}
cache-read-only: ${{ github.ref != 'refs/heads/1.20.1' }}
add-job-summary: on-failure

- name: Grant Execute Permission for gradlew
shell: bash
run: chmod +x gradlew
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build

on:
push:
branches: [ "1.20.1" ]
paths:
- 'src/**'
- 'gradle/**'
- '**/*.gradle.kts'
- '**/gradle.properties'
- '.github/workflows/**'
- '.github/actions/**'
pull_request:
branches: [ "1.20.1" ]

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
env:
CI: true
steps:
- name: Checkout Repository
uses: actions/checkout@v6

- name: Setup Environment
uses: ./.github/actions/setup

- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Get Mod Information
id: info
run: |
MOD_VERSION=$(grep -oP 'mod_version=\K.*' gradle.properties)
MC_VERSION=$(grep -oP 'minecraft_version=\K.*' gradle.properties)
echo "mod_version=$MOD_VERSION" >> $GITHUB_OUTPUT
echo "mc_version=$MC_VERSION" >> $GITHUB_OUTPUT
echo "sha_short=$(echo '${{ github.sha }}' | cut -c 1-7)" >> $GITHUB_OUTPUT

- name: Upload Artifacts
uses: actions/upload-artifact@v6
with:
name: hoarding-${{ steps.info.outputs.mc_version }}-${{ steps.info.outputs.mod_version }}+${{ steps.info.outputs.sha_short }}
path: build/libs/*.jar
if-no-files-found: error
retention-days: 7