Skip to content

Commit 5c2dda5

Browse files
committed
Migrate PowerAdvantage 1.12.2 to ForgeGradle 7
1 parent b711827 commit 5c2dda5

38 files changed

Lines changed: 1217 additions & 357 deletions

‎.github/workflows/ci.yml‎

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Power Advantage 1.12 CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master-1.12.2
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.12.2
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: poweradvantage-1.12-${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
name: Build, test, and audit
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 60
24+
25+
steps:
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: Stage exact RebornCore compile API
48+
id: reborncore
49+
run: |
50+
mirror="$RUNNER_TEMP/reborncore-mirror"
51+
bash gradle/stage-reborncore-release.sh "$mirror"
52+
echo "repository=$mirror" >> "$GITHUB_OUTPUT"
53+
54+
- name: Build and audit release artifacts
55+
run: >-
56+
./gradlew clean check build javadoc verifyReleaseDependencies verifyReleaseArtifacts
57+
writeReleaseChecksums verifyEclipseProductionClasspath
58+
-PrebornCoreVerificationRepository=${{ steps.reborncore.outputs.repository }}
59+
--no-daemon --stacktrace
60+
61+
- name: Upload audited release candidate
62+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
63+
with:
64+
name: PowerAdvantage-1.12.2-${{ github.sha }}
65+
if-no-files-found: error
66+
retention-days: 30
67+
path: |
68+
build/libs/PowerAdvantage-2.4.1.112021.jar
69+
build/libs/PowerAdvantage-2.4.1.112021-sources.jar
70+
build/libs/PowerAdvantage-2.4.1.112021-javadoc.jar
71+
build/release/SHA256SUMS
72+
CHANGELOG.txt
73+
74+
- name: Upload diagnostics on failure
75+
if: failure()
76+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
77+
with:
78+
name: PowerAdvantage-1.12.2-diagnostics-${{ github.sha }}
79+
if-no-files-found: ignore
80+
retention-days: 14
81+
path: |
82+
build/test-results/**
83+
build/reports/**
84+
build/*-run/logs/**
85+
build/problems/**
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches:
6+
- master-1.12.2
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.12.2
11+
schedule:
12+
- cron: '47 7 * * 4'
13+
14+
permissions:
15+
actions: read
16+
contents: read
17+
security-events: write
18+
19+
jobs:
20+
analyze:
21+
name: Analyze Java
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 45
24+
25+
steps:
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: Stage exact RebornCore compile API
45+
id: reborncore
46+
run: |
47+
mirror="$RUNNER_TEMP/reborncore-mirror"
48+
bash gradle/stage-reborncore-release.sh "$mirror"
49+
echo "repository=$mirror" >> "$GITHUB_OUTPUT"
50+
51+
- name: Initialize CodeQL
52+
uses: github/codeql-action/init@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
53+
with:
54+
languages: java-kotlin
55+
56+
- name: Compile production code
57+
run: |
58+
chmod +x ./gradlew
59+
./gradlew clean classes --rerun-tasks --no-build-cache --no-daemon --stacktrace \
60+
-PrebornCoreVerificationRepository=${{ steps.reborncore.outputs.repository }}
61+
62+
- name: Analyze
63+
uses: github/codeql-action/analyze@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Validate Power Advantage release tag
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*.*'
7+
8+
permissions:
9+
actions: read
10+
contents: read
11+
12+
concurrency:
13+
group: poweradvantage-release-tag-${{ 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/PowerAdvantage'
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 this target and has a successful Build, test, and audit check."
84+
echo
85+
echo "**Nothing has been published.**"
86+
echo
87+
echo "Live publication requires \`deploy-release.yml\` on the repository default branch."
88+
echo "Once that guarded dispatcher is installed, continue at: $RELEASE_WORKFLOW_URL"
89+
} >> "$GITHUB_STEP_SUMMARY"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Validate Gradle Wrapper
2+
3+
on:
4+
push:
5+
branches:
6+
- master-1.12.2
7+
- 'feature/**'
8+
pull_request:
9+
branches:
10+
- master-1.12.2
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
validation:
17+
name: Validation
18+
runs-on: ubuntu-latest
19+
steps:
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: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,61 @@
1-
*.class
2-
*.iml
3-
*.ipr
4-
*.iws
5-
*.classpath
6-
*.project
7-
*.prefs
8-
.metadata/
1+
# Eclipse
2+
/bin/
93
*.launch
10-
/output
4+
/.settings/
5+
/.metadata/
6+
/.classpath
7+
/.project
8+
/.eclipse/
119

12-
# Local agent notes
13-
/AGENT.md
10+
# IntelliJ IDEA
11+
/out/
12+
*.ipr
13+
*.iws
14+
*.iml
15+
/.idea/
16+
17+
# Gradle and Forge run output
18+
/build/
19+
/.gradle/
20+
/eclipse/
21+
/run/
22+
/run-data/
23+
/run.*
24+
/*.log
25+
/classes/
26+
/logs/
27+
/mcmodsrepo/
28+
/.ci-dependencies/
29+
30+
# Machine-specific agent context
1431
/AGENTS.md
32+
/AGENT.md
1533
/agent-notes/
16-
.agent/
17-
.agents/
18-
.codex/
19-
.claude/
20-
CLAUDE.md
21-
.aider*
22-
.cursor/
23-
.cursorrules
34+
/.agent/
35+
/.agents/
36+
/.codex/
37+
/.claude/
38+
/.gemini/
39+
/CLAUDE.md
40+
/agent-*.md
41+
/codex-*.md
42+
43+
# Local verification and profiling evidence
44+
/run-*/
45+
/benchmark-*/
46+
/regression-*/
47+
/evidence/
48+
/evidence-*/
49+
/*-evidence/
50+
/*.jfr
51+
/*.hprof
52+
/hs_err_pid*.log
53+
/replay_pid*.log
2454

25-
#ForgeGradle
26-
/build
27-
/.gradle
28-
/eclipse/assets
55+
# Local dependency experiments; the RF API is an intentional tracked input.
2956
/libs/*
3057
!/libs/RF-API.jar
3158
!/libs/RF-API.zip
32-
/bin/
33-
/run/
34-
/out/
59+
60+
/secret.json
61+
/.DS_Store

‎.travis.yml‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎CHANGELOG.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Power Advantage 2.4.1.112021
2+
3+
- Restore conduit networks and machine GUI state after a world reload.
4+
- Move the Minecraft 1.12.2 build to ForgeGradle 7 and Gradle 9.6.1.
5+
- Build with a Java 8 toolchain while running Gradle on Java 17.
6+
- Pin optional compile APIs and keep Base Metals and OreSpawn off the build classpath.
7+
- Add reproducible release jars, dependency and artifact audits, checksums, and GitHub CI.
8+
- Preserve the poweradvantage runtime identity and cyano.poweradvantage.api compatibility surface.

‎README.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
# PowerAdvantage
2+
3+
Power Advantage provides shared power, fluid, and item transport systems for its Minecraft 1.12.2 expansion mods.
4+
5+
## Building Minecraft 1.12.2
6+
7+
The `master-1.12.2` build uses ForgeGradle 7.0.34 and Gradle 9.6.1. Run Gradle with Java 17; Gradle resolves the Java 8 toolchain used for compilation.
8+
9+
```text
10+
gradlew.bat clean check build verifyReleaseDependencies verifyReleaseArtifacts writeReleaseChecksums
11+
```
12+
13+
Release jars are written to `build/libs`. The deobfuscated development jar for sibling mod compilation is written to `build/libs-dev` by `deobfJar` or `build`.
14+
15+
For Eclipse, import the repository as an existing Gradle project and run:
16+
17+
```text
18+
gradlew.bat cleanEclipse verifyEclipseProductionClasspath
19+
```
20+
21+
Base Metals and OreSpawn remain required distribution dependencies but are deliberately absent from the compile classpath. Optional RF and RebornCore integrations compile against SHA-256-pinned API inputs and are not bundled or added to normal development launches. CI stages the exact historical RebornCore Maven release because the later CurseForge archive with the same version has different contents.

0 commit comments

Comments
 (0)