Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Mineralogy 1.17.1 CI

on:
push:
branches:
- master-1.17.1
- 'feature/**'
pull_request:
branches:
- master-1.17.1

permissions:
contents: read

concurrency:
group: mineralogy-1.17-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build, test, and audit
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Install Java 16 toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '16.0.2+7'

- name: Install Java 17 for Gradle
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: microsoft
java-version: '17'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6

- name: Stage exact OreSpawn release dependency
id: orespawn
run: |
mirror="$RUNNER_TEMP/orespawn-mirror"
bash gradle/stage-orespawn-release.sh "$mirror"
echo "repository=$mirror" >> "$GITHUB_OUTPUT"

- name: Build, test, and audit release artifacts
run: |
chmod +x ./gradlew
./gradlew clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts writeReleaseChecksums \
-PorespawnVerificationRepository="${{ steps.orespawn.outputs.repository }}" \
--no-daemon --stacktrace

- name: Generate and audit Eclipse production launches
run: >-
./gradlew genEclipseRuns eclipse isolateEclipseProductionRuns verifyEclipseProductionClasspath
-PorespawnVerificationRepository=${{ steps.orespawn.outputs.repository }}
--no-daemon --stacktrace

- name: Upload audited release candidate
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: Mineralogy-1.17.1-${{ github.sha }}
if-no-files-found: error
retention-days: 30
path: |
build/libs/Mineralogy-6.1.0.117011.jar
build/libs/Mineralogy-6.1.0.117011-sources.jar
build/libs/Mineralogy-6.1.0.117011-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.txt

- name: Upload diagnostics on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: Mineralogy-1.17.1-diagnostics-${{ github.sha }}
if-no-files-found: ignore
retention-days: 14
path: |
build/test-results/**
build/reports/**
build/*-run/logs/**
build/problems/**
53 changes: 53 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CodeQL

on:
push:
branches:
- master-1.17.1
- 'feature/**'
pull_request:
branches:
- master-1.17.1

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
name: Analyze Java
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Install Java 16 toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '16.0.2+7'

- name: Install Java 17 for Gradle
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: microsoft
java-version: '17'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6

- name: Initialize CodeQL
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
with:
languages: java-kotlin

- name: Compile production code
run: |
chmod +x ./gradlew
./gradlew clean classes --rerun-tasks --no-build-cache --no-daemon --stacktrace

- name: Analyze
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
92 changes: 92 additions & 0 deletions .github/workflows/release-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Validate Mineralogy release tag

on:
push:
tags:
- '*.*.*.*'

permissions:
actions: read
contents: read

concurrency:
group: mineralogy-release-tag-${{ github.ref_name }}
cancel-in-progress: false

jobs:
validate-release-tag:
name: Validate tag for manual release confirmation
if: github.repository == 'MinecraftModDevelopmentMods/MinecraftMineralogy'
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Check out tagged source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0

- name: Validate release tag, target metadata, and prior CI
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail

value() { sed -n "s/^$1=//p" gradle.properties; }
release_version="$(value mod_version)"
minecraft_version="$(value minecraft_version)"
loader_name="$(value loader_name)"
loader_code="$(value loader_code)"

IFS=. read -r mc_major mc_minor mc_patch extra <<<"$minecraft_version"
if [[ -n "${extra:-}" || -z "${mc_major:-}" || -z "${mc_minor:-}" ]]; then
echo "Invalid minecraft_version=$minecraft_version" >&2
exit 1
fi
mc_patch="${mc_patch:-0}"
if [[ ! "$mc_major" =~ ^[0-9]+$ || ! "$mc_minor" =~ ^[0-9]+$ || ! "$mc_patch" =~ ^[0-9]+$ ]]; then
echo "Invalid minecraft_version=$minecraft_version" >&2
exit 1
fi
case "$loader_name:$loader_code" in
forge:1|neoforge:2) ;;
*) echo "Invalid loader metadata $loader_name/$loader_code" >&2; exit 1 ;;
esac
printf -v minor_padded '%02d' "$((10#$mc_minor))"
printf -v patch_padded '%02d' "$((10#$mc_patch))"
target_suffix="${mc_major}${minor_padded}${patch_padded}${loader_code}"

if [[ ! "$release_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.${target_suffix}$ ]]; then
echo "mod_version $release_version does not match $minecraft_version $loader_name target $target_suffix" >&2
exit 1
fi
if [[ "$GITHUB_REF_NAME" != "$release_version" ]]; then
echo "Release tag must equal mod_version $release_version; found $GITHUB_REF_NAME" >&2
exit 1
fi

successful_ci="$(gh api \
"repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs?per_page=100" \
--jq '[.check_runs[] | select(.name == "Build, test, and audit" and .conclusion == "success")] | length')"
if [[ "$successful_ci" -lt 1 ]]; then
echo "The tagged commit has no successful Build, test, and audit check" >&2
exit 1
fi

- name: Record the manual publication interface
env:
RELEASE_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/workflows/deploy-release.yml
run: |
{
echo "## Release tag validated"
echo
echo "Tag \`$GITHUB_REF_NAME\` matches the selected target and has a successful Build, test, and audit check."
echo
echo "If this tag was created outside the release workflow, nothing has been published."
echo
echo "To start or recover publication, open [Release Mineralogy]($RELEASE_WORKFLOW_URL), select **Run workflow**, and enter:"
echo
echo "- release version: \`$GITHUB_REF_NAME\`"
echo "- CurseForge release level: \`release\`, \`beta\`, or \`alpha\`"
echo "- confirm live publication: checked"
} >> "$GITHUB_STEP_SUMMARY"
23 changes: 23 additions & 0 deletions .github/workflows/validate-gradle-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Validate Gradle Wrapper

on:
push:
branches:
- master-1.17.1
- 'feature/**'
pull_request:
branches:
- master-1.17.1

permissions:
contents: read

jobs:
validation:
name: Validation
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Validate wrapper integrity
uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build
eclipse
run
classes
logs
/logs/

# local agent context
/AGENTS.md
Expand Down
44 changes: 22 additions & 22 deletions .project
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Mineralogy</name>
<comment></comment>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<linkedResources/>
<filteredResources/>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MinecraftMineralogy</name>
<comment></comment>
<projects/>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments/>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments/>
</buildCommand>
</buildSpec>
<linkedResources/>
<filteredResources/>
</projectDescription>
Loading
Loading