Skip to content

Commit 2b4cce4

Browse files
authored
Merge pull request #257 from SkyBlade1978/master-1.16.5
Port OreSpawn 4.0.9.116051 to Forge 1.16.5
2 parents 81946fc + 427c613 commit 2b4cce4

45 files changed

Lines changed: 2445 additions & 1055 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,77 @@
1-
name: CI
1+
name: OreSpawn 1.16.5 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.16.5
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.16.5
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: orespawn-1.16-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
1118

1219
jobs:
1320
build:
21+
name: Build, test, and audit
1422
runs-on: ubuntu-latest
15-
name: Build
23+
timeout-minutes: 60
24+
1625
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-java@v1
26+
- name: Check out source
27+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
28+
29+
- name: Install Java 8 toolchain
30+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
31+
with:
32+
distribution: temurin
33+
java-version: '8.0.502+7'
34+
35+
- name: Install Java 17 for Gradle
36+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
37+
with:
38+
distribution: microsoft
39+
java-version: '17'
40+
41+
- name: Set up Gradle
42+
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
43+
44+
- name: Make the wrapper executable
45+
run: chmod +x ./gradlew
46+
47+
- name: Build, test, and audit release artifacts
48+
run: >-
49+
./gradlew clean check build javadoc verifyReleaseArtifacts writeReleaseChecksums
50+
verifyEclipseProductionClasspath --no-daemon --stacktrace
51+
52+
- name: Upload audited release candidate
53+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
54+
with:
55+
name: OreSpawn-1.16.5-${{ github.sha }}
56+
if-no-files-found: error
57+
retention-days: 30
58+
path: |
59+
build/libs/OreSpawn-4.0.9.116051.jar
60+
build/libs/OreSpawn-4.0.9.116051-sources.jar
61+
build/libs/OreSpawn-4.0.9.116051-javadoc.jar
62+
build/release/SHA256SUMS
63+
CHANGELOG.txt
64+
65+
- name: Upload diagnostics on failure
66+
if: failure()
67+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
1968
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
69+
name: OreSpawn-1.16.5-diagnostics-${{ github.sha }}
70+
if-no-files-found: ignore
71+
retention-days: 14
72+
path: |
73+
build/test-results/**
74+
build/reports/**
75+
build/*-run/logs/**
76+
build/surface-integration-run/**/*.properties
77+
build/problems/**
Lines changed: 49 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,55 @@
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"
13-
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'
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches:
6+
- master-1.16.5
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.16.5
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
45-
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
55-
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
60-
61-
# ℹ️ Command-line programs to run using the OS shell.
62-
# 📚 https://git.io/JvXDl
63-
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
67-
68-
#- run: |
69-
# make bootstrap
70-
# make release
71-
72-
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v1
26+
- name: Check out source
27+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
28+
29+
- name: Install Java 8 toolchain
30+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
31+
with:
32+
distribution: temurin
33+
java-version: '8.0.502+7'
34+
35+
- name: Install Java 17 for Gradle
36+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
37+
with:
38+
distribution: microsoft
39+
java-version: '17'
40+
41+
- name: Set up Gradle
42+
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
43+
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
46+
with:
47+
languages: java-kotlin
48+
49+
- name: Compile production code
50+
run: |
51+
chmod +x ./gradlew
52+
./gradlew clean classes --no-daemon --stacktrace
53+
54+
- name: Analyze
55+
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Start OreSpawn release from tag
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*.*'
7+
8+
permissions:
9+
actions: read
10+
contents: read
11+
12+
concurrency:
13+
group: orespawn-release-starter-${{ github.ref_name }}
14+
cancel-in-progress: false
15+
16+
jobs:
17+
validate-release-tag:
18+
name: Validate tag for manual release confirmation
19+
if: github.repository == 'MinecraftModDevelopmentMods/OreSpawn'
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 10
22+
23+
steps:
24+
- name: Check out tagged source
25+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Validate release tag, target metadata, and prior CI
30+
env:
31+
GH_TOKEN: ${{ github.token }}
32+
run: |
33+
set -euo pipefail
34+
35+
value() { sed -n "s/^$1=//p" gradle.properties; }
36+
release_version="$(value mod_version)"
37+
minecraft_version="$(value minecraft_version)"
38+
loader_name="$(value loader_name)"
39+
loader_code="$(value loader_code)"
40+
41+
IFS=. read -r mc_major mc_minor mc_patch extra <<<"$minecraft_version"
42+
if [[ -n "${extra:-}" || -z "${mc_major:-}" || -z "${mc_minor:-}" ]]; then
43+
echo "Invalid minecraft_version=$minecraft_version" >&2
44+
exit 1
45+
fi
46+
mc_patch="${mc_patch:-0}"
47+
if [[ ! "$mc_major" =~ ^[0-9]+$ || ! "$mc_minor" =~ ^[0-9]+$ || ! "$mc_patch" =~ ^[0-9]+$ ]]; then
48+
echo "Invalid minecraft_version=$minecraft_version" >&2
49+
exit 1
50+
fi
51+
case "$loader_name:$loader_code" in
52+
forge:1|neoforge:2) ;;
53+
*) echo "Invalid loader metadata $loader_name/$loader_code" >&2; exit 1 ;;
54+
esac
55+
printf -v minor_padded '%02d' "$((10#$mc_minor))"
56+
printf -v patch_padded '%02d' "$((10#$mc_patch))"
57+
target_suffix="${mc_major}${minor_padded}${patch_padded}${loader_code}"
58+
59+
if [[ ! "$release_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.${target_suffix}$ ]]; then
60+
echo "mod_version $release_version does not match $minecraft_version $loader_name target $target_suffix" >&2
61+
exit 1
62+
fi
63+
if [[ "$GITHUB_REF_NAME" != "$release_version" ]]; then
64+
echo "Release tag must equal mod_version $release_version; found $GITHUB_REF_NAME" >&2
65+
exit 1
66+
fi
67+
68+
successful_ci="$(gh api \
69+
"repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs?per_page=100" \
70+
--jq '[.check_runs[] | select(.name == "Build, test, and audit" and .conclusion == "success")] | length')"
71+
if [[ "$successful_ci" -lt 1 ]]; then
72+
echo "The tagged commit has no successful Build, test, and audit check" >&2
73+
exit 1
74+
fi
75+
76+
- name: Record the required manual publication step
77+
env:
78+
RELEASE_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/workflows/deploy-release.yml
79+
run: |
80+
{
81+
echo "## Release candidate validated"
82+
echo
83+
echo "Tag \`$GITHUB_REF_NAME\` matches the selected target and has a successful Build, test, and audit check."
84+
echo
85+
echo "**Nothing has been published.**"
86+
echo
87+
echo "To continue, open [Deploy OreSpawn release]($RELEASE_WORKFLOW_URL), select **Run workflow**, and enter:"
88+
echo
89+
echo "- release_version: \`$GITHUB_REF_NAME\`"
90+
echo "- curseforge_release_level: \`release\`, \`beta\`, or \`alpha\`"
91+
echo "- confirm_live_publication: \`true\`"
92+
echo
93+
echo "The dispatcher builds and audits the immutable bundle before the separate \`release\` environment approval gate."
94+
} >> "$GITHUB_STEP_SUMMARY"

.github/workflows/sonarqube.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
name: Validate Gradle Wrapper
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master-1.16.5
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.16.5
11+
12+
permissions:
13+
contents: read
414

515
jobs:
616
validation:
7-
name: "Validation"
17+
name: Validation
818
runs-on: ubuntu-latest
919
steps:
10-
- uses: actions/checkout@v2
11-
- uses: gradle/wrapper-validation-action@v1
20+
- name: Check out source
21+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
22+
- name: Validate wrapper integrity
23+
uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ run
2828
classes
2929
logs
3030
/mcmodsrepo/
31+
/src/generated/resources/META-INF/orespawn/docs/
32+
/config/orespawn-worldgen.json
3133

3234
# machine-specific agent context (public integration notes live under /docs)
3335
/AGENTS.md

0 commit comments

Comments
 (0)