Skip to content

Commit f7b9571

Browse files
committed
Update CICD
1 parent 5b859b2 commit f7b9571

19 files changed

Lines changed: 466 additions & 409 deletions

.github/actions/build_setup/action.yml

Lines changed: 2 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: |

.github/workflows/build_and_test.yml

Lines changed: 9 additions & 7 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,19 +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
3941

4042
- name: Compile the mod
41-
run: ./gradlew --info --scan assemble
43+
run: ./gradlew --info --scan --stacktrace assemble
4244

4345
- name: Upload Jars
44-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@v5
4547
with:
4648
name: GTExpert-Core
4749
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: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ on:
1818

1919
env:
2020
# link to the changelog with a format code for the version
21-
CHANGELOG_LOCATION: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/GTExpertCore-v${{ github.event.inputs.version }}-${{ github.event.inputs.release_type }})"
21+
CHANGELOG_LOCATION: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/GTWoodProcessing-v${{ github.event.inputs.version }}-${{ github.event.inputs.release_type }})"
2222
# Version of the mod
2323
FULL_VERSION: "${{ github.event.inputs.version }}-${{ github.event.inputs.release_type }}"
2424
# type of release
25-
NAME: "GTExpertCore"
25+
NAME: "GTWoodProcessing"
2626

2727
# Curseforge and Modrinth project IDs
28-
CURSEFORGE_PROJECT_ID: "851103"
29-
MODRINTH_PROJECT_ID: "ipueNiWG"
28+
CURSEFORGE_PROJECT_ID: "1093753"
29+
MODRINTH_PROJECT_ID: "LRBGeIQP"
3030

3131
concurrency:
32-
group: publish-${{ github.head_ref || github.ref }}
32+
group: publish-${{ inputs.target_branch || github.ref }}
3333
cancel-in-progress: true
3434

3535
jobs:
@@ -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,14 +55,14 @@ 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
@@ -79,36 +82,32 @@ jobs:
7982
modrinth-id: ${{ env.MODRINTH_PROJECT_ID }}
8083
modrinth-token: "${{ secrets.MODRINTH_API_KEY }}"
8184
modrinth-dependencies: |
82-
G1ckZuWK(required)
8385
tULldUx4(required)
84-
tZiutdLG(required)
8586
curseforge-id: ${{ env.CURSEFORGE_PROJECT_ID }}
8687
curseforge-token: "${{ secrets.CURSEFORGE_API_KEY }}"
8788
curseforge-dependencies: |
88-
mixin-booter(required)
8989
gregtech-ce-unofficial(required)
90-
gregicality-multiblocks(required)
91-
implosionnobomb(recommended)
92-
ae2-extended-life(recommended)
93-
ae-additions-extra-cells-2-fork(recommended)
94-
nae2(recommended)
95-
ender-io-base(recommended)
96-
ender-io-machines(recommended)
97-
ender-io-endergy(recommended)
98-
ender-io-conduits(recommended)
99-
ender-io-ae2-conduits(recommended)
100-
gregtech-food-option(recommended)
101-
chisel(recommended)
102-
extracpus(recommended)
103-
draconic-evolution(recommended)
104-
draconicadditions(recommended)
105-
project-red-illumination(recommended)
106-
avaritia-1-1x-unofficial(recommended)
107-
thaumcraft(recommended)
108-
forestry(recommended)
109-
gendustry(recommended)
110-
binnies-mods-patched(recommended)
111-
ulv-covers(incompatible)
90+
advanced-rocketry(optional)
91+
binnies-mods-patched(optional)
92+
biomes-o-plenty(optional)
93+
botania(optional)
94+
extra-utilities(optional)
95+
forestry(optional)
96+
gregtech-food-option(optional)
97+
ice-and-fire-dragons(optional)
98+
integrated-dynamics(optional)
99+
mystical-world(optional)
100+
natura(optional)
101+
nether-update-backport(optional)
102+
plants(optional)
103+
project-vibrant-journeys(optional)
104+
random-things(optional)
105+
roots(optional)
106+
rustic(optional)
107+
thaumcraft(optional)
108+
the-twilight-forest(optional)
109+
traverse-reforged(optional)
110+
wizardry-mod(optional)
112111
files: |
113112
build/libs/!(*-@(dev|sources|javadoc)).jar
114113
build/libs/*-@(sources).jar

.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)