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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mcmod.info text
*.lang text
*.mcmeta text
*.md text
*.patch text eol=lf -diff
*.properties text
gradlew text eol=lf
*.sh text eol=lf
Expand Down
165 changes: 147 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,153 @@
name: CI
name: OreSpawn 1.20.1 CI

on: [push, pull_request]
#on:
# push:
# branches: [ master-1.12 ]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ master-1.12 ]
# types: [opened, synchronize, reopened]
on:
push:
branches:
- master-1.20.1
- 'feature/**'
pull_request:
branches:
- master-1.20.1

permissions:
contents: read

concurrency:
group: orespawn-1.20.1-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
cold-forge-bootstrap:
name: Cold Forge bootstrap
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Install pinned Java 25 Mavenizer runtime
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '25.0.3+9.0.LTS'

- name: Install pinned Java 8 launcher toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '8.0.502+7'

- name: Install pinned Java 17 runtime and toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '17.0.1+12'

- name: Bootstrap Forge from an empty cache
shell: bash
env:
GRADLE_USER_HOME: ${{ runner.temp }}/orespawn-cold-gradle
run: |
set -euo pipefail
test ! -e .gradle
test ! -e "$GRADLE_USER_HOME"
mkdir -p "$GRADLE_USER_HOME"
chmod +x ./gradlew
./gradlew verifyMavenizerCompatibilityFixture help \
--no-daemon --no-build-cache --stacktrace --max-workers=2 \
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64" \
-Dorg.gradle.java.installations.auto-detect=false \
-Dorg.gradle.java.installations.auto-download=false \
| tee "$RUNNER_TEMP/cold-forge-bootstrap.log"
grep -F "OreSpawn Mavenizer compatibility runtime: Java 25.0.3" \
"$RUNNER_TEMP/cold-forge-bootstrap.log"
grep -F "OreSpawn Mavenizer compatibility: applied 8 rule(s) for net.minecraftforge:forge:1.20.1-47.4.10" \
"$RUNNER_TEMP/cold-forge-bootstrap.log"
find "$GRADLE_USER_HOME" .gradle/mavenizer \
-name '*.orespawn-compatibility' -type f -print0 \
| sort -z | xargs -0 -r sha256sum > "$RUNNER_TEMP/markers-before.sha256"
test -s "$RUNNER_TEMP/markers-before.sha256"

- name: Verify same-cache preparation is idempotent
shell: bash
env:
GRADLE_USER_HOME: ${{ runner.temp }}/orespawn-cold-gradle
run: |
set -euo pipefail
./gradlew verifyMavenizerCompatibilityFixture help \
--no-daemon --no-build-cache --stacktrace --max-workers=2 \
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64" \
-Dorg.gradle.java.installations.auto-detect=false \
-Dorg.gradle.java.installations.auto-download=false
find "$GRADLE_USER_HOME" .gradle/mavenizer \
-name '*.orespawn-compatibility' -type f -print0 \
| sort -z | xargs -0 -r sha256sum > "$RUNNER_TEMP/markers-after.sha256"
diff -u "$RUNNER_TEMP/markers-before.sha256" "$RUNNER_TEMP/markers-after.sha256"

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

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: chmod a+x gradlew
- run: ./gradlew --version --no-daemon
- run: ./gradlew setupCIWorkspace -S
- run: ./gradlew clean build -S
- name: Check out source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Install pinned Java 25 Mavenizer runtime
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '25.0.3+9.0.LTS'

- name: Install pinned Java 8 launcher toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '8.0.502+7'

- name: Install pinned Java 17 runtime and toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '17.0.1+12'

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

- name: Make the wrapper executable
run: chmod +x ./gradlew

- name: Build, test, and audit release artifacts
run: >-
./gradlew clean check build javadoc verifyReleaseArtifacts writeReleaseChecksums
verifyEclipseProductionClasspath --no-daemon --stacktrace
-Dorg.gradle.java.installations.paths="$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
-Dorg.gradle.java.installations.auto-detect=false
-Dorg.gradle.java.installations.auto-download=false

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

- name: Upload diagnostics on failure
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: OreSpawn-1.20.1-diagnostics-${{ github.sha }}
if-no-files-found: ignore
retention-days: 14
path: |
build/test-results/**
build/reports/**
build/*-run/logs/**
build/surface-integration-run/**/*.properties
build/problems/**
123 changes: 63 additions & 60 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,76 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: CodeQL

on: [push, pull_request]
#on:
# push:
# branches: [ master-1.12 ]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ master-1.12 ]
# types: [opened, synchronize, reopened]
# schedule:
# - cron: '43 7 * * 4'
on:
push:
branches:
- master-1.20.1
- 'feature/**'
pull_request:
branches:
- master-1.20.1
schedule:
- cron: '43 7 * * 4'

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

jobs:
analyze:
name: Analyze
name: Analyze Java
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# 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
timeout-minutes: 45

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

- name: Install pinned Java 25 Mavenizer runtime
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '25.0.3+9.0.LTS'

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

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Install pinned Java 17 runtime and toolchain
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
with:
distribution: temurin
java-version: '17.0.1+12'

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

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

#- run: |
# make bootstrap
# make release
- name: Compile production code
run: |
chmod +x ./gradlew
gradle_args=(
clean classes --no-daemon --stacktrace
"-Dorg.gradle.java.installations.paths=$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64"
-Dorg.gradle.java.installations.auto-detect=false
-Dorg.gradle.java.installations.auto-download=false
)
for attempt in 1 2 3; do
if ./gradlew "${gradle_args[@]}"; then
exit 0
fi
if [ "$attempt" -eq 3 ]; then
echo "CodeQL compilation failed after $attempt attempts." >&2
exit 1
fi
echo "::warning::CodeQL compilation attempt $attempt failed; retrying with the preserved Forge cache."
done

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Analyze
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
Loading
Loading