Skip to content

Commit 4f145c2

Browse files
committed
Fix project
1 parent 33d3adb commit 4f145c2

24 files changed

Lines changed: 1133 additions & 1070 deletions

.editorconfig

Lines changed: 673 additions & 673 deletions
Large diffs are not rendered by default.

.github/actions/build_setup/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212

1313
steps:
1414
- name: Set up JDK 8 and 17
15-
uses: actions/setup-java@v4
15+
uses: actions/setup-java@v5
1616
with:
1717
cache: gradle
1818
distribution: 'zulu'
@@ -21,7 +21,7 @@ runs:
2121
17
2222
2323
- name: Setup Gradle
24-
uses: gradle/actions/setup-gradle@v4
24+
uses: gradle/actions/setup-gradle@v5
2525
with:
2626
cache-write-only: ${{ inputs.update-cache }}
2727
gradle-home-cache-includes: |
@@ -30,3 +30,7 @@ runs:
3030
notifications
3131
jdks
3232
wrapper
33+
34+
- name: Grant execute permission for gradlew
35+
shell: bash
36+
run: chmod +x gradlew

.github/workflows/build_and_test.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
type: boolean
1717

1818
concurrency:
19-
group: build-and-test-${{ github.head_ref || github.ref }}
19+
group: build-and-test-${{ inputs.target_branch || github.ref }}
2020
cancel-in-progress: true
2121

2222
jobs:
@@ -29,22 +29,21 @@ jobs:
2929

3030
steps:
3131
- name: Checkout Repository
32-
uses: actions/checkout@v4
33-
34-
- name: Apply patch to gradle.properties
35-
run: sed -i 's/debug_all = false/debug_all = true/g' gradle.properties
32+
uses: actions/checkout@v6
33+
with:
34+
ref: ${{ inputs.target_branch || github.ref }}
35+
36+
- name: Apply patch to buildscript.properties
37+
run: sed -i 's/debug_all = false/debug_all = true/g' buildscript.properties
3638

3739
- name: Setup Build
3840
uses: ./.github/actions/build_setup
39-
40-
- name: Grant execute permission for gradlew
41-
run: chmod +x gradlew
4241

4342
- name: Compile the mod
44-
run: ./gradlew --info --scan assemble
43+
run: ./gradlew --info --scan --stacktrace assemble
4544

4645
- name: Upload Jars
47-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@v5
4847
with:
4948
name: GTBeesMatrix
5049
path: build/libs/*.jar

.github/workflows/format_java.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
name: Java Formatting
33

44
on:
5-
push:
6-
branches:
7-
- master
8-
paths: ['src/main/java/**', 'src/test/**']
95
pull_request:
106
paths: ['src/main/java/**', 'src/test/**']
117

128
concurrency:
13-
group: format-${{ github.head_ref || github.ref }}
9+
group: format-${{ inputs.target_branch || github.ref }}
1410
cancel-in-progress: true
1511

1612
jobs:
@@ -24,19 +20,29 @@ jobs:
2420

2521
steps:
2622
- name: Checkout Repository
27-
uses: actions/checkout@v4
23+
uses: actions/checkout@v6
2824
with:
29-
ref: ${{ github.head_ref }}
25+
ref: ${{ inputs.target_branch || github.ref }}
3026

3127
- name: Setup Build
3228
uses: ./.github/actions/build_setup
3329

30+
- name: Check if PR is from a fork
31+
id: fork-check
32+
run: |
33+
if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then
34+
echo "is_fork=true" >> $GITHUB_OUTPUT
35+
else
36+
echo "is_fork=false" >> $GITHUB_OUTPUT
37+
fi
38+
shell: bash
39+
3440
- name: Run Spotless Formatting Check with Gradle
3541
id: build
36-
run: ./gradlew --info spotlessCheck
42+
run: ./gradlew --info --stacktrace spotlessCheck
3743

3844
- name: Attempt to make a PR fixing spotless errors
39-
if: failure() && steps.build.conclusion == 'failure'
45+
if: failure() && steps.build.conclusion == 'failure' && steps.fork-check.outputs.is_fork == 'false'
4046
run: |
4147
git reset --hard
4248
git checkout "${PR_BRANCH}"
@@ -54,9 +60,16 @@ jobs:
5460
--body "Automatic spotless apply to fix formatting errors, applies to PR #${PR_NUMBER}" \
5561
2>&1 | tee pr-message.log || true
5662
gh pr comment "${PR_BRANCH}" -F pr-message.log || true
57-
shell: bash # ensures set -eo pipefail
63+
shell: bash
5864
env:
5965
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6066
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
6167
PR_NUMBER: ${{ github.event.pull_request.number }}
6268
FIXED_BRANCH: ${{ github.head_ref }}-spotless-fixes
69+
70+
- name: Comment to PR if from fork and formatting failed
71+
if: failure() && steps.build.conclusion == 'failure' && steps.fork-check.outputs.is_fork == 'true'
72+
run: |
73+
gh pr comment ${{ github.event.pull_request.number }} --body "I can't get automatic fixes by spotless in CI. Please run '. /gradlew spotlessApply' and push again."
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ jobs:
4242

4343
steps:
4444
- name: Checkout Repository
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@v6
46+
with:
47+
ref: ${{ inputs.target_branch || github.ref }}
48+
fetch-tags: true
4649

4750
- name: Check if tag already exists
4851
run: |
@@ -52,21 +55,18 @@ jobs:
5255
fi
5356
5457
- name: Set version
55-
run: sed -i "s/modVersion.*=.*/modVersion = ${{ env.FULL_VERSION }}/g" gradle.properties
58+
run: sed -i "s/modVersion.*=.*/modVersion = ${{ env.FULL_VERSION }}/g" buildscript.properties
5659

57-
- name: Commit and push gradle.properties
58-
uses: stefanzweifel/git-auto-commit-action@v5
60+
- name: Commit and push buildscript.properties
61+
uses: stefanzweifel/git-auto-commit-action@v7
5962
with:
6063
commit_message: "Bump version to v${{ env.FULL_VERSION }}"
6164
commit_options: '--no-verify'
62-
file_pattern: gradle.properties
65+
file_pattern: buildscript.properties
6366
tagging_message: "v${{ env.FULL_VERSION }}"
6467

6568
- name: Setup Build
6669
uses: ./.github/actions/build_setup
67-
68-
- name: Grant execute permission for gradlew
69-
run: chmod +x gradlew
7070

7171
- name: Build Project
7272
run: ./gradlew --info build

.github/workflows/rebase.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/test_java.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22
name: Java Tests
33

44
on:
5-
push:
6-
branches:
7-
- master
85
pull_request:
96
branches:
107
- '*'
118

129
concurrency:
13-
group: test-${{ github.head_ref || github.ref }}
10+
group: test-${{ inputs.target_branch || github.ref }}
1411
cancel-in-progress: true
1512

1613
jobs:
@@ -20,13 +17,15 @@ jobs:
2017

2118
steps:
2219
- name: Checkout Repository
23-
uses: actions/checkout@v4
20+
uses: actions/checkout@v6
21+
with:
22+
ref: ${{ inputs.target_branch || github.ref }}
2423

25-
- name: Apply patch to build.gradle
26-
run: sed -i 's/debug_all = false/debug_all = true/g' gradle.properties
24+
- name: Apply patch to buildscript.properties
25+
run: sed -i 's/debug_all = false/debug_all = true/g' buildscript.properties
2726

2827
- name: Setup Build
2928
uses: ./.github/actions/build_setup
3029

3130
- name: Run Tests with Gradle
32-
run: ./gradlew --info --scan test
31+
run: ./gradlew --info --scan --stacktrace test

.github/workflows/update_buildscript.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ jobs:
1919

2020
steps:
2121
- name: Checkout Repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
23+
with:
24+
ref: ${{ inputs.target_branch || github.ref }}
2325

2426
- name: Setup Build
2527
uses: ./.github/actions/build_setup
2628

2729
- name: Run Buildscript Updater
28-
run: ./gradlew --info updateBuildScript
30+
run: ./gradlew --info --stacktrace updateBuildScript
2931

3032
- name: Get New Buildscript Version
3133
id: version-check
@@ -35,7 +37,7 @@ jobs:
3537
3638
- name: Create Pull Request
3739
id: create-pull-request
38-
uses: peter-evans/create-pull-request@v6
40+
uses: peter-evans/create-pull-request@v7
3941
env:
4042
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4143
with:

.github/workflows/update_gradle_cache.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
workflow_dispatch:
1010

1111
concurrency:
12-
group: gradle-cache-${{ github.ref }}
12+
group: gradle-cache-${{ inputs.target_branch || github.ref }}
1313
cancel-in-progress: true
1414

1515
jobs:
@@ -19,12 +19,14 @@ jobs:
1919

2020
steps:
2121
- name: Checkout Repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
23+
with:
24+
ref: ${{ inputs.target_branch || github.ref }}
2325

2426
- name: Setup Build
2527
uses: ./.github/actions/build_setup
2628
with:
2729
update-cache: true
2830

2931
- name: Build Project with Gradle
30-
run: ./gradlew --info assemble
32+
run: ./gradlew --info --stacktrace assemble

.github/workflows/validate_gradle_wrapper.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)