Skip to content

Commit 0ab4510

Browse files
authored
Merge pull request #278 from SkyBlade1978/master-1.21.11
Port OreSpawn 4.0.16 to Forge 1.21.11
2 parents cd85241 + debcc79 commit 0ab4510

74 files changed

Lines changed: 4963 additions & 568 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mcmod.info text
1111
*.lang text
1212
*.mcmeta text
1313
*.md text
14+
*.patch text eol=lf -diff
1415
*.properties text
1516
gradlew text eol=lf
1617
*.sh text eol=lf

.github/workflows/ci.yml

Lines changed: 147 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,153 @@
1-
name: CI
1+
name: OreSpawn 1.21.11 CI
22

3-
on: [push, pull_request]
4-
#on:
5-
# push:
6-
# branches: [ master-1.12 ]
7-
# pull_request:
8-
# # The branches below must be a subset of the branches above
9-
# branches: [ master-1.12 ]
10-
# types: [opened, synchronize, reopened]
3+
on:
4+
push:
5+
branches:
6+
- master-1.21.11
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.21.11
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: orespawn-1.21.11-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
1118

1219
jobs:
20+
cold-forge-bootstrap:
21+
name: Cold Forge bootstrap
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 60
24+
steps:
25+
- name: Check out source
26+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
27+
28+
- name: Install pinned Java 25 Mavenizer runtime
29+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
30+
with:
31+
distribution: temurin
32+
java-version: '25.0.3+9.0.LTS'
33+
34+
- name: Install pinned Java 8 launcher toolchain
35+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
36+
with:
37+
distribution: temurin
38+
java-version: '8.0.502+7'
39+
40+
- name: Install pinned Java 21 runtime and toolchain
41+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
42+
with:
43+
distribution: temurin
44+
java-version: '21.0.7+6.0.LTS'
45+
46+
- name: Bootstrap Forge from an empty cache
47+
shell: bash
48+
env:
49+
GRADLE_USER_HOME: ${{ runner.temp }}/orespawn-cold-gradle
50+
run: |
51+
set -euo pipefail
52+
test ! -e .gradle
53+
test ! -e "$GRADLE_USER_HOME"
54+
mkdir -p "$GRADLE_USER_HOME"
55+
chmod +x ./gradlew
56+
./gradlew verifyMavenizerCompatibilityFixture help \
57+
--no-daemon --no-build-cache --stacktrace --max-workers=2 \
58+
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64" \
59+
-Dorg.gradle.java.installations.auto-detect=false \
60+
-Dorg.gradle.java.installations.auto-download=false \
61+
| tee "$RUNNER_TEMP/cold-forge-bootstrap.log"
62+
grep -F "OreSpawn Mavenizer compatibility runtime: Java 25.0.3" \
63+
"$RUNNER_TEMP/cold-forge-bootstrap.log"
64+
grep -F "OreSpawn Mavenizer compatibility: applied 0 rule(s) for net.minecraftforge:forge:1.21.11-61.1.0 (explicit no-op)" \
65+
"$RUNNER_TEMP/cold-forge-bootstrap.log"
66+
find "$GRADLE_USER_HOME" .gradle/mavenizer \
67+
-name '*.orespawn-compatibility' -type f -print0 \
68+
| sort -z | xargs -0 -r sha256sum > "$RUNNER_TEMP/markers-before.sha256"
69+
test -s "$RUNNER_TEMP/markers-before.sha256"
70+
71+
- name: Verify same-cache preparation is idempotent
72+
shell: bash
73+
env:
74+
GRADLE_USER_HOME: ${{ runner.temp }}/orespawn-cold-gradle
75+
run: |
76+
set -euo pipefail
77+
./gradlew verifyMavenizerCompatibilityFixture help \
78+
--no-daemon --no-build-cache --stacktrace --max-workers=2 \
79+
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64" \
80+
-Dorg.gradle.java.installations.auto-detect=false \
81+
-Dorg.gradle.java.installations.auto-download=false
82+
find "$GRADLE_USER_HOME" .gradle/mavenizer \
83+
-name '*.orespawn-compatibility' -type f -print0 \
84+
| sort -z | xargs -0 -r sha256sum > "$RUNNER_TEMP/markers-after.sha256"
85+
diff -u "$RUNNER_TEMP/markers-before.sha256" "$RUNNER_TEMP/markers-after.sha256"
86+
1387
build:
88+
name: Build, test, and audit
1489
runs-on: ubuntu-latest
15-
name: Build
90+
timeout-minutes: 60
91+
1692
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-java@v1
19-
with:
20-
java-version: 8
21-
- run: chmod a+x gradlew
22-
- run: ./gradlew --version --no-daemon
23-
- run: ./gradlew setupCIWorkspace -S
24-
- run: ./gradlew clean build -S
93+
- name: Check out source
94+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
95+
96+
- name: Install pinned Java 25 Mavenizer runtime
97+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
98+
with:
99+
distribution: temurin
100+
java-version: '25.0.3+9.0.LTS'
101+
102+
- name: Install pinned Java 8 launcher toolchain
103+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
104+
with:
105+
distribution: temurin
106+
java-version: '8.0.502+7'
107+
108+
- name: Install pinned Java 21 runtime and toolchain
109+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
110+
with:
111+
distribution: temurin
112+
java-version: '21.0.7+6.0.LTS'
113+
114+
- name: Set up Gradle
115+
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
116+
117+
- name: Make the wrapper executable
118+
run: chmod +x ./gradlew
119+
120+
- name: Build, test, and audit release artifacts
121+
run: >-
122+
./gradlew clean check build javadoc verifyReleaseArtifacts writeReleaseChecksums
123+
verifyEclipseProductionClasspath --no-daemon --stacktrace
124+
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
125+
-Dorg.gradle.java.installations.auto-detect=false
126+
-Dorg.gradle.java.installations.auto-download=false
127+
128+
- name: Upload audited release candidate
129+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
130+
with:
131+
name: OreSpawn-1.21.11-${{ github.sha }}
132+
if-no-files-found: error
133+
retention-days: 30
134+
path: |
135+
build/libs/OreSpawn-4.0.16.121111.jar
136+
build/libs/OreSpawn-4.0.16.121111-sources.jar
137+
build/libs/OreSpawn-4.0.16.121111-javadoc.jar
138+
build/release/SHA256SUMS
139+
CHANGELOG.txt
140+
141+
- name: Upload diagnostics on failure
142+
if: failure()
143+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
144+
with:
145+
name: OreSpawn-1.21.11-diagnostics-${{ github.sha }}
146+
if-no-files-found: ignore
147+
retention-days: 14
148+
path: |
149+
build/test-results/**
150+
build/reports/**
151+
build/*-run/logs/**
152+
build/surface-integration-run/**/*.properties
153+
build/problems/**
Lines changed: 63 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,76 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
12-
name: "CodeQL"
1+
name: CodeQL
132

14-
on: [push, pull_request]
15-
#on:
16-
# push:
17-
# branches: [ master-1.12 ]
18-
# pull_request:
19-
# # The branches below must be a subset of the branches above
20-
# branches: [ master-1.12 ]
21-
# types: [opened, synchronize, reopened]
22-
# schedule:
23-
# - cron: '43 7 * * 4'
3+
on:
4+
push:
5+
branches:
6+
- master-1.21.11
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.21.11
11+
schedule:
12+
- cron: '43 7 * * 4'
13+
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
2418

2519
jobs:
2620
analyze:
27-
name: Analyze
21+
name: Analyze Java
2822
runs-on: ubuntu-latest
29-
permissions:
30-
actions: read
31-
contents: read
32-
security-events: write
33-
34-
strategy:
35-
fail-fast: false
36-
matrix:
37-
language: [ 'java' ]
38-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
39-
# Learn more:
40-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
23+
timeout-minutes: 45
4124

4225
steps:
43-
- name: Checkout repository
44-
uses: actions/checkout@v2
26+
- name: Check out source
27+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
28+
29+
- name: Install pinned Java 25 Mavenizer runtime
30+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
31+
with:
32+
distribution: temurin
33+
java-version: '25.0.3+9.0.LTS'
4534

46-
# Initializes the CodeQL tools for scanning.
47-
- name: Initialize CodeQL
48-
uses: github/codeql-action/init@v1
49-
with:
50-
languages: ${{ matrix.language }}
51-
# If you wish to specify custom queries, you can do so here or in a config file.
52-
# By default, queries listed here will override any specified in a config file.
53-
# Prefix the list here with "+" to use these queries and those in the config file.
54-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
35+
- name: Install pinned Java 8 launcher toolchain
36+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
37+
with:
38+
distribution: temurin
39+
java-version: '8.0.502+7'
5540

56-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57-
# If this step fails, then you should remove it and run the build manually (see below)
58-
- name: Autobuild
59-
uses: github/codeql-action/autobuild@v1
41+
- name: Install pinned Java 21 runtime and toolchain
42+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
43+
with:
44+
distribution: temurin
45+
java-version: '21.0.7+6.0.LTS'
6046

61-
# ℹ️ Command-line programs to run using the OS shell.
62-
# 📚 https://git.io/JvXDl
47+
- name: Set up Gradle
48+
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
6349

64-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
65-
# and modify them (or add more) to build your code if your project
66-
# uses a compiled language
50+
- name: Initialize CodeQL
51+
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
52+
with:
53+
languages: java-kotlin
6754

68-
#- run: |
69-
# make bootstrap
70-
# make release
55+
- name: Compile production code
56+
run: |
57+
chmod +x ./gradlew
58+
gradle_args=(
59+
clean classes --no-daemon --stacktrace
60+
"-Dorg.gradle.java.installations.paths=$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
61+
-Dorg.gradle.java.installations.auto-detect=false
62+
-Dorg.gradle.java.installations.auto-download=false
63+
)
64+
for attempt in 1 2 3; do
65+
if ./gradlew "${gradle_args[@]}"; then
66+
exit 0
67+
fi
68+
if [ "$attempt" -eq 3 ]; then
69+
echo "CodeQL compilation failed after $attempt attempts." >&2
70+
exit 1
71+
fi
72+
echo "::warning::CodeQL compilation attempt $attempt failed; retrying with the preserved Forge cache."
73+
done
7174
72-
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v1
75+
- name: Analyze
76+
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4

0 commit comments

Comments
 (0)