Skip to content

Update gradle.yml

Update gradle.yml #48

Workflow file for this run

name: Mod Compile Checks
on:
push:
branches: [ "1.20.1" ]
pull_request:
branches: [ "1.20.1" ]
jobs:
release-jar-snapshot:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_yaml: |
src:
- src/**
- name: Set up JDK 17
if: steps.changed-files.outputs.src_any_changed == 'true'
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
if: steps.changed-files.outputs.src_any_changed == 'true'
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
- name: Read Properties
if: steps.changed-files.outputs.src_any_changed == 'true'
id: readproperties
uses: BrycensRanch/read-properties-action@v1
with:
file: gradle.properties
all: true
- name: Truncate Git SHA
if: steps.changed-files.outputs.src_any_changed == 'true'
id: truncated
uses: actions/github-script@v7.0.1
with:
script: |
const sha = context.sha.substring(1,6)
core.setOutput('sha', sha)
core.setOutput('versionStr', '${{steps.readproperties.outputs.mod_version}}.alpha.' + sha)
core.setOutput('shouldBuild', (context.eventName === "push" && "${{steps.changed-files.outputs.src_any_changed}}" == "true").toString())
- name: Run Data Generation (Server, Client)
if: steps.changed-files.outputs.src_any_changed == 'true'
id: datagen
env:
MOD_VERSION: ${{ steps.truncated.outputs.versionStr }}
JAVA_OPTS: -Dlog4j.configuration=log4j.properties
run: ./gradlew runData
- name: Build JAR file
if: steps.truncated.outputs.shouldBuild == 'true'
env:
MOD_VERSION: ${{ steps.truncated.outputs.versionStr }}
JAVA_OPTS: -Dlog4j.configuration=log4j.properties
run: ./gradlew build
- name: Generate Checksum
if: steps.truncated.outputs.shouldBuild == 'true'
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
build/libs/*
- name: Fetch Last Release Checksum
if: steps.truncated.outputs.shouldBuild == 'true'
uses: robinraju/release-downloader@v1.10
with:
latest: true
fileName: checksum.txt
out-file-path: "lastRelease"
- name: Last Release Has Checksum?
if: steps.truncated.outputs.shouldBuild == 'true

Check failure on line 76 in .github/workflows/gradle.yml

View workflow run for this annotation

GitHub Actions / Mod Compile Checks

Invalid workflow file

The workflow is not valid. .github/workflows/gradle.yml (Line: 76, Col: 11): Unexpected symbol: ''true'. Located at position 40 within expression: steps.truncated.outputs.shouldBuild == 'true
id: has-checksum
uses: andstor/file-existence-action@v3
with:
files: lastRelease/checksum.txt
- name: Check Checksums
if: steps.has-checksum.outputs.files_exists == 'true'
id: sum-check
uses: LouisBrunner/diff-action@v2.0.0
with:
old: lastRelease/checksum.txt
new: checksum.txt
- name: Create Release
if: steps.has-checksum.outputs.files_exists == 'false' || steps.sum-check.outputs.passed == 'false'
uses: softprops/action-gh-release@v2
with:
files: checksum.txt build/libs/*
tag_name: snapshot-${{ steps.truncated.outputs.sha }}
name: ${{steps.readproperties.outputs.mod_name}} ${{ steps.truncated.outputs.versionStr }}
draft: false