diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12d5f5b..aed0ed8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,10 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: repository: MinecraftModDevelopmentMods/OreSpawn - ref: 6a7c2bb07b9a7771128812fcc07d185f7d9df58b + ref: 487805da1c3ad9f90fd4679eacc052bab2271b0b path: .ci-dependencies/OreSpawn - name: Use canonical LF dependency inputs - # Base Metals predates archive text normalization; its LF artifact is separately pinned. + # Keep dependency text files consistent between Linux and Windows. run: git config --global core.autocrlf false - name: Read dependency source pins id: pins @@ -82,12 +82,13 @@ jobs: mirror="$RUNNER_TEMP/orespawn-mirror" (cd "$basemetals" && bash gradle/stage-orespawn-release.sh "$mirror" && ./gradlew jar "-PorespawnVerificationRepository=$mirror" --no-daemon --stacktrace) - osjar="$orespawn/build/libs-dev/OreSpawn-4.1.0.113021-deobf.jar" + osjar="$orespawn/build/libs-dev/OreSpawn-4.1.7.113021-deobf.jar" bm_version=$(sed -n 's/^basemetals_version=//p' gradle.properties) + power_version=$(sed -n 's/^basepower_version=//p' gradle.properties) bmjar="$basemetals/build/libs-dev/BaseMetals-$bm_version-deobf.jar" (cd "$power" && ./gradlew jar verifyReleaseDependencies \ -PbaseMetalsDeobfJar="$bmjar" -PoreSpawnDeobfJar="$osjar" --no-daemon --stacktrace) - powerjar="$power/build/libs-dev/basePower-2.4.5.113021-deobf.jar" + powerjar="$power/build/libs-dev/basePower-$power_version-deobf.jar" test -f "$osjar" && test -f "$bmjar" && test -f "$powerjar" echo "orespawn=$osjar" >> "$GITHUB_OUTPUT" echo "basemetals=$bmjar" >> "$GITHUB_OUTPUT" @@ -107,9 +108,9 @@ jobs: if-no-files-found: error retention-days: 30 path: | - build/libs/baseSteam-2.2.7.113021.jar - build/libs/baseSteam-2.2.7.113021-sources.jar - build/libs/baseSteam-2.2.7.113021-javadoc.jar + build/libs/baseSteam-2.2.8.113021.jar + build/libs/baseSteam-2.2.8.113021-sources.jar + build/libs/baseSteam-2.2.8.113021-javadoc.jar build/release/SHA256SUMS CHANGELOG.txt - name: Upload diagnostics on failure diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d2c7c79..e2a7b73 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,10 +25,10 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: repository: MinecraftModDevelopmentMods/OreSpawn - ref: 6a7c2bb07b9a7771128812fcc07d185f7d9df58b + ref: 487805da1c3ad9f90fd4679eacc052bab2271b0b path: .ci-dependencies/OreSpawn - name: Use canonical LF dependency inputs - # Base Metals predates archive text normalization; its LF artifact is separately pinned. + # Keep dependency text files consistent between Linux and Windows. run: git config --global core.autocrlf false - name: Read dependency source pins id: pins @@ -82,12 +82,13 @@ jobs: mirror="$RUNNER_TEMP/orespawn-mirror" (cd "$basemetals" && bash gradle/stage-orespawn-release.sh "$mirror" && ./gradlew jar "-PorespawnVerificationRepository=$mirror" --no-daemon --stacktrace) - osjar="$orespawn/build/libs-dev/OreSpawn-4.1.0.113021-deobf.jar" + osjar="$orespawn/build/libs-dev/OreSpawn-4.1.7.113021-deobf.jar" bm_version=$(sed -n 's/^basemetals_version=//p' gradle.properties) + power_version=$(sed -n 's/^basepower_version=//p' gradle.properties) bmjar="$basemetals/build/libs-dev/BaseMetals-$bm_version-deobf.jar" (cd "$power" && ./gradlew jar verifyReleaseDependencies \ -PbaseMetalsDeobfJar="$bmjar" -PoreSpawnDeobfJar="$osjar" --no-daemon --stacktrace) - powerjar="$power/build/libs-dev/basePower-2.4.5.113021-deobf.jar" + powerjar="$power/build/libs-dev/basePower-$power_version-deobf.jar" test -f "$osjar" && test -f "$bmjar" && test -f "$powerjar" echo "orespawn=$osjar" >> "$GITHUB_OUTPUT" echo "basemetals=$bmjar" >> "$GITHUB_OUTPUT" diff --git a/.gitignore b/.gitignore index cb99cf1..9476a37 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,7 @@ /replay_pid*.log /secret.json +/gradle/development-dependencies.properties # Nested local tooling and generated output AGENTS.md AGENT.md diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 329d20c..cd1feae 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,8 @@ +2.2.8.113021 - baseSteam for Minecraft 1.13.2 + +- Use the released Base Metals 3.0.3 and OreSpawn 4.1.7 builds with basePower 2.4.7. +- Require the basePower update that fixes an intermittent world load and save crash. + 2.2.7.113021 - baseSteam for Minecraft 1.13.2 - Bring baseSteam to Forge 1.13.2. Keep your steam workshop when moving from Steam Advantage or an earlier baseSteam release. diff --git a/README.md b/README.md index 3378bf3..4370120 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,29 @@ baseSteam continues DrCyano's Steam Advantage, adding boilers, pipework, storage and steam-powered machines to basePower. -Use basePower `2.4.5.113021` and Base Metals `3.0.2.113021` for Forge 1.13.2. baseSteam's machines and parts are on the shared **basePower** creative tab. Back up the world and config, then replace the old jars together and test on a copy. Save, close Minecraft completely, and reopen the copy to check your machines. +Use basePower `2.4.7.113021` and Base Metals `3.0.3.113021` for Forge 1.13.2. baseSteam's machines and parts are on the shared **basePower** creative tab. Back up the world and config, then replace the old jars together and test on a copy. Save, close Minecraft completely, and reopen the copy to check your machines. + +The [current dependency qualification](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/DEPENDENCY-QUALIFICATION-20261115.md) records the candidate jars, automated checks and release order. The recipe book unlocks steam recipes when you pick up the ingredients. See the [material checklist](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/RECIPE-DISCOVERY.md). Crushing is a machine recipe, so it doesn't appear in the crafting book. After changing recipes, run `node tools/generate-recipe-unlocks.js` and `check`. -The [manufacturing progression audit](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/MANUFACTURING-PROGRESSION.md) checks raw-material, processing and loot acquisition paths in every mode, including restart persistence. +The [manufacturing progression audit](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/MANUFACTURING-PROGRESSION.md) checks raw-material, processing and loot acquisition paths in every mode, including restart persistence. ## Building Minecraft 1.13.2 The `master-1.13.2` build uses ForgeGradle 7.0.34 and Gradle 9.6.1. Run Gradle with Java 17; production code is compiled for Java 8. -Build the pinned basePower, Base Metals and OreSpawn development jars first. The source commits and checksums in `gradle.properties` keep local and CI builds on the same inputs. +Build the pinned development jars from the released basePower 2.4.7.113021, +Base Metals 3.0.3.113021 and OreSpawn 4.1.7.113021 sources first. The Power pin +matches [CurseForge file 9638343](https://www.curseforge.com/minecraft/mc-mods/basepower/files/9638343). +No local dependency override is needed for these public releases. +For future unpublished candidates, create the ignored file `gradle/development-dependencies.properties` +with `allowUnreleasedDependencies=true`. Jar checksums and versions are still +verified. Publication stays blocked in local mode. Before release, record the +published source commit and CurseForge file ID instead of `UNRELEASED`, then +disable local mode. +The local file can pin `baseMetalsDeobfJar`, `oreSpawnDeobfJar` and +`powerAdvantageDeobfJar` to checked copies under `libs/development`. With the standard sibling layout: ```text @@ -42,18 +54,18 @@ The Eclipse resource root is `build/resources/main`, so its builder copies expan ## Compatibility -The [stronger regression-test backport](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/TEST-COVERAGE-BACKPORT.md) +The [stronger regression-test backport](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/TEST-COVERAGE-BACKPORT.md) records measured machine work, restart checks, repaired windows and remaining limits. -For an all-Advantage play-test, run `prepareCombinedEclipseLaunch` in the sibling PowerAdvantage checkout and select its `runClientAllAdvantage.launch`. The [native resource probe](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/test-rig/client-resources/README.md) checks models, textures and names across all three mods. These resource checks do not replace gameplay testing. +For a combined play-test, run `prepareCombinedEclipseLaunch` in the sibling basePower checkout and select its `runClientAllAdvantage.launch`. The [native resource probe](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/test-rig/client-resources/README.md) checks models, textures and names across all three mods. These resource checks do not replace gameplay testing. The implementation namespace is `zone.moddev.mc.basesteam`. Steam registers its legacy block and tile mappings with basePower so old Steam Advantage and baseSteam worlds can be converted before Minecraft flattens the saved block states. Boiler heat, tanks, inventories and drill state are carried over rather than reinitialised. -Read PowerAdvantage's [1.13 migration guide](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/MIGRATION.md) before upgrading, and always use a backup. The [qualification notes](https://github.com/MinecraftModDevelopmentMods/PowerAdvantage/blob/master-1.13.2/docs/1.13/CURRENT-QUALIFICATION.md) list the tested scenarios and remaining gaps. +Read basePower's [1.13 migration guide](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/MIGRATION.md) before upgrading, and always use a backup. The [qualification notes](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/CURRENT-QUALIFICATION.md) list the tested scenarios and remaining gaps. ## Generator Follow-Up -The [generator follow-up](../../PowerAdvantage/docs/1.13/TEST-COVERAGE-BACKPORT.md#generator-follow-up) records the older `pa113-candidate-g` inputs. +The [generator follow-up](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/TEST-COVERAGE-BACKPORT.md#generator-follow-up) records the older `pa113-candidate-g` inputs. Its 126 operating jobs and 126 cold checks, 39 GUI windows, 351 caption cases, 355 rejected broken controls, eight frozen routes, five connected routes and paired 30-minute runs passed. This is a pre-final Steam-control checkpoint, @@ -62,7 +74,7 @@ the final sweep. Manual play-testing and release review remain separate. ## Final T Candidate -The [final-t checkpoint](../../PowerAdvantage/docs/1.13/TEST-COVERAGE-BACKPORT.md#final-t-candidate) +The [final-t checkpoint](https://github.com/MinecraftModDevelopmentMods/basePower/blob/master-1.13.2/docs/1.13/TEST-COVERAGE-BACKPORT.md#final-t-candidate) records profile `pa113-candidate-i` and its exact jar hashes. All 132 operating jobs and 132 cold-restart comparisons pass, including an independent audit of six Steam controls and their nine tile-hold records. GUI checks pass for 39 diff --git a/build.gradle b/build.gradle index f8b860e..c3ed99b 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,8 @@ plugins { id 'net.minecraftforge.gradle' version '7.0.34' } +apply from: 'gradle/development-dependencies.gradle' + group = project.mod_group version = project.mod_version base.archivesName = 'baseSteam' @@ -169,7 +171,8 @@ def defaultPowerAdvantageDeobfJar = file("../../PowerAdvantage/build/libs-dev/" + "basePower-${project.basepower_version}-deobf.jar") def powerAdvantageDeobfJar = providers.gradleProperty('powerAdvantageDeobfJar') .map { file(it) } - .getOrElse(defaultPowerAdvantageDeobfJar) + .getOrElse(file(developmentDependencyFiles.getProperty('powerAdvantageDeobfJar', + defaultPowerAdvantageDeobfJar.path))) if (!powerAdvantageDeobfJar.isFile()) { throw new GradleException("Missing PowerAdvantage deobf jar at ${powerAdvantageDeobfJar}. " + "Run gradlew.bat deobfJar in ../../PowerAdvantage first, or pass " @@ -178,15 +181,17 @@ if (!powerAdvantageDeobfJar.isFile()) { // These defaults follow the sibling MMD checkout layout. They are constants // here so another developer can override them without editing the script. def baseMetalsDeobfJar = file(providers.gradleProperty('baseMetalsDeobfJar') - .getOrElse('../../../../BaseMetals/BaseMetals 113/BaseMetals/build/libs-dev/' - + "BaseMetals-${project.basemetals_version}-deobf.jar")) + .getOrElse(developmentDependencyFiles.getProperty('baseMetalsDeobfJar', + '../../../../BaseMetals/BaseMetals 113/BaseMetals/build/libs-dev/' + + "BaseMetals-${project.basemetals_version}-deobf.jar"))) if (!baseMetalsDeobfJar.isFile()) { throw new GradleException("Missing Base Metals deobf jar at ${baseMetalsDeobfJar}. " + "Build Base Metals 1.13 first, or pass -PbaseMetalsDeobfJar=.") } def oreSpawnDeobfJar = file(providers.gradleProperty('oreSpawnDeobfJar') - .getOrElse('../../../../MinecraftMineralogy/OS113/OreSpawn/build/libs-dev/' - + 'OreSpawn-4.1.0.113021-deobf.jar')) + .getOrElse(developmentDependencyFiles.getProperty('oreSpawnDeobfJar', + '../../../../MinecraftMineralogy/OS113/OreSpawn/build/libs-dev/' + + "OreSpawn-${project.orespawn_version}-deobf.jar"))) if (!oreSpawnDeobfJar.isFile()) { throw new GradleException("Missing OreSpawn deobf jar at ${oreSpawnDeobfJar}. " + "Build OreSpawn 1.13 first, or pass -PoreSpawnDeobfJar=.") @@ -341,7 +346,7 @@ tasks.register('verifyReleaseConfiguration') { group = 'verification' description = 'Validates release identity, target metadata, and dependency policy.' doLast { - if (project.mod_version != '2.2.7.113021') { + if (project.mod_version != '2.2.8.113021') { throw new GradleException("Unexpected SteamAdvantage release version: ${project.mod_version}") } if (project.minecraft_version != '1.13.2' @@ -368,10 +373,12 @@ tasks.register('verifyReleaseConfiguration') { || project.cf_versions != '1.13.2') { throw new GradleException('Unexpected CurseForge dependency or game-version metadata') } - if (project.basepower_version != '2.4.5.113021' + if (project.basepower_version != '2.4.7.113021' || project.basepower_source_repository != 'MinecraftModDevelopmentMods/basePower' - || !(project.basepower_source_ref ==~ /[a-f0-9]{40}/) - || !(project.basepower_curse_file_id ==~ /[0-9]+/) + || (!(project.basepower_source_ref ==~ /[a-f0-9]{40}/) + && !(localDependencyBuild && project.basepower_source_ref == 'UNRELEASED')) + || (!(project.basepower_curse_file_id ==~ /[0-9]+/) + && !(localDependencyBuild && project.basepower_curse_file_id == 'UNRELEASED')) || !(project.basepower_release_sha256 ==~ /[A-F0-9]{64}/) || !(project.basepower_deobf_sha256 ==~ /[A-F0-9]{64}/)) { throw new GradleException('Unexpected PowerAdvantage compile dependency identity') @@ -379,12 +386,12 @@ tasks.register('verifyReleaseConfiguration') { String mainSource = file( 'src/main/java/zone/moddev/mc/basesteam/SteamAdvantage.java').getText('UTF-8') if (!mainSource.contains('MODID = "basesteam"') - || !mainSource.contains('VERSION = "2.2.7.113021"')) { + || !mainSource.contains('VERSION = "2.2.8.113021"')) { throw new GradleException('SteamAdvantage source identity changed') } String metadata = file('src/main/resources/META-INF/mods.toml').getText('UTF-8').replace('\r\n', '\n') ['modId="basesteam"', 'modId="basepower"', 'modId="basemetals"', - 'versionRange="[2.4.5.113021,3.0.0)"'].each { marker -> + 'versionRange="[2.4.7.113021,3.0.0)"'].each { marker -> if (!metadata.contains(marker)) { throw new GradleException("Source mods.toml is missing ${marker}") } @@ -424,7 +431,7 @@ tasks.register('verifyReleaseDependencies') { String actualBaseMetalsHash = MessageDigest.getInstance('SHA-256') .digest(baseMetalsDeobfJar.bytes).encodeHex().toString().toUpperCase() if (!(actualBaseMetalsHash in [project.basemetals_deobf_sha256, - project.basemetals_deobf_lf_sha256])) { + project.findProperty('basemetals_deobf_lf_sha256')])) { throw new GradleException("Base Metals SHA-256 is ${actualBaseMetalsHash}, expected " + project.basemetals_deobf_sha256) } diff --git a/gradle.properties b/gradle.properties index 32ef6ea..881c5ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ curseforge_project_id=1781373 mod_id=basesteam mod_name=baseSteam mod_license=GPL-3.0-only -mod_version=2.2.7.113021 +mod_version=2.2.8.113021 mod_group=zone.moddev.mc.basesteam mod_authors=DrCyano mod_description=Steam-powered machines and infrastructure for the Power Advantage platform. @@ -34,18 +34,16 @@ cf_requirements=basepower,base-metals cf_optionals= cf_versions=1.13.2 -basepower_version=2.4.5.113021 +basepower_version=2.4.7.113021 basepower_source_repository=MinecraftModDevelopmentMods/basePower -basepower_source_ref=6c1498a6858cec36ad029a921484d63a8a856c9f -basepower_deobf_sha256=8079DA3B187A81C23B627DAEE4F81D25D9E21A98EFA350FA261B07A2614164FF -basepower_curse_file_id=9474258 -basepower_release_sha256=C1F99D108D3AB897F138F16CC77693C5EEE4AE1B19D291A7CDB51C67BB1500C8 +basepower_source_ref=f4f19e3b72c997f4aa03d090e29ece772722a1e5 +basepower_deobf_sha256=60E95563ED0169CF8EE1967CFAA976DADBAAA9722EA009D18102A22A16309D04 +basepower_curse_file_id=9638343 +basepower_release_sha256=E7140E83D55D9FF71F63CD24FCBC09A6F95D24F800C93E83BD6CD60F6A63C74C -basemetals_version=3.0.2.113021 -basemetals_source_commit=37717d0b9be31e8d73cfedf5d6a3c184af3ea579 -basemetals_deobf_sha256=5A9A9E6B339B294CCFCD0DF3E8A51BA4CEF623EA084D9A5486C418A3B5995AFB -# Same pinned source and class bytes, with a clean LF checkout on Linux. -basemetals_deobf_lf_sha256=77CA0123FFB345F103AE64CC52FB4DA157D6867A44BABEA761EE188896D2AD83 +basemetals_version=3.0.3.113021 +basemetals_source_commit=4891e836b00356e13f0bbef631650f5539188e80 +basemetals_deobf_sha256=D69AAD7B52FEB558404FF460FBB76FF4B46733692E4B113A69957274FB99CF01 -orespawn_version=4.1.0.113021 -orespawn_deobf_sha256=F5A015584000CCEF0E94D8BB567E7B75603B37F10A88BFC5A129176D487BB038 +orespawn_version=4.1.7.113021 +orespawn_deobf_sha256=30943F730BA492C0A2FB1861A465F624286EA1724C9FE362FC8C587BBAD5629F diff --git a/gradle/development-dependencies.gradle b/gradle/development-dependencies.gradle new file mode 100644 index 0000000..c7577ad --- /dev/null +++ b/gradle/development-dependencies.gradle @@ -0,0 +1,21 @@ +// Local candidates need exact jar checks, but cannot have release provenance yet. +File settingsFile = file('gradle/development-dependencies.properties') +Properties settings = new Properties() +if (settingsFile.isFile()) settingsFile.withInputStream { settings.load(it) } +ext.localDependencyBuild = providers.gradleProperty('useDevelopmentDependencies') + .map { it.toBoolean() } + .getOrElse(settings.getProperty('allowUnreleasedDependencies', 'false').toBoolean()) +ext.developmentDependencyFiles = localDependencyBuild ? settings : new Properties() +if (localDependencyBuild) logger.lifecycle('Using pinned local dependency candidates. Publication is disabled.') + +def publicationGuard = tasks.register('verifyPublishableDependencies') { + group = 'verification' + description = 'Refuses publication while a dependency is still a local candidate.' + doLast { + if (localDependencyBuild || project.findProperty('basemetals_source_commit') == 'UNRELEASED' + || project.findProperty('basepower_source_ref') == 'UNRELEASED') { + throw new GradleException('Publish the dependency candidates and record their released pins before publishing this mod.') + } + } +} +tasks.matching { it.name.startsWith('publish') }.configureEach { dependsOn publicationGuard } diff --git a/src/main/java/zone/moddev/mc/basesteam/SteamAdvantage.java b/src/main/java/zone/moddev/mc/basesteam/SteamAdvantage.java index b201fb5..d211750 100644 --- a/src/main/java/zone/moddev/mc/basesteam/SteamAdvantage.java +++ b/src/main/java/zone/moddev/mc/basesteam/SteamAdvantage.java @@ -35,7 +35,7 @@ public final class SteamAdvantage { public static final String MODID = "basesteam"; public static final String NAME = "Steam Advantage"; - public static final String VERSION = "2.2.7.113021"; + public static final String VERSION = "2.2.8.113021"; public static final Logger LOGGER = LogManager.getLogger(MODID); public static float MUSKET_DAMAGE = 20.0F; diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 436a820..1a1a171 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -14,14 +14,14 @@ description='''Steam-powered machines and infrastructure for the Power Advantage [[dependencies.basesteam]] modId="basepower" mandatory=true -versionRange="[2.4.5.113021,3.0.0)" +versionRange="[2.4.7.113021,3.0.0)" ordering="AFTER" side="BOTH" [[dependencies.basesteam]] modId="basemetals" mandatory=false -versionRange="[3.0.2.113021,4.0.0)" +versionRange="[3.0.3.113021,4.0.0)" ordering="AFTER" side="BOTH" diff --git a/src/test/java/zone/moddev/mc/basesteam/resources/BuildWorkflowContractTest.java b/src/test/java/zone/moddev/mc/basesteam/resources/BuildWorkflowContractTest.java new file mode 100644 index 0000000..fba8676 --- /dev/null +++ b/src/test/java/zone/moddev/mc/basesteam/resources/BuildWorkflowContractTest.java @@ -0,0 +1,22 @@ +package zone.moddev.mc.basesteam.resources; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import org.junit.Test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class BuildWorkflowContractTest { + @Test + public void workflowsUseTheDeclaredPowerVersion() throws Exception { + for (String name : new String[] {"ci.yml", "codeql-analysis.yml"}) { + String workflow = new String(Files.readAllBytes(Paths.get(".github/workflows", name)), + StandardCharsets.UTF_8); + assertTrue(name, workflow.contains("power_version=$(sed -n 's/^basepower_version=//p' gradle.properties)")); + assertTrue(name, workflow.contains("basePower-$power_version-deobf.jar")); + assertFalse(name, workflow.contains("basePower-2.4.")); + } + } +}