From e4ec593368650ec768be8f285a5cc779570a02ad Mon Sep 17 00:00:00 2001 From: Layue13 Date: Wed, 28 Oct 2026 19:41:53 +0800 Subject: [PATCH] build: publish through Stratum (project mode): Nexus, --g --- .github/workflows/build.yml | 12 +++++++----- build.gradle | 28 +--------------------------- dependencies.gradle | 14 +++++--------- gradle.properties | 1 - settings.gradle | 12 +++++++++++- 5 files changed, 24 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed4f022..db45e8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,12 +22,17 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: false +# Organisation-wide Stratum settings (registry, group, runner routes) are organisation variables. +env: + STRATUM_PUBLISH_URL: ${{ vars.STRATUM_PUBLISH_URL }} + STRATUM_RESOLVE_URL: ${{ vars.STRATUM_RESOLVE_URL }} + STRATUM_GROUP_ID: ${{ vars.STRATUM_GROUP_ID }} + STRATUM_ROUTES: ${{ vars.STRATUM_ROUTES }} + jobs: build: runs-on: ubuntu-latest timeout-minutes: 90 - env: - ARTIFACT_GROUP_ID: uk.potatolab steps: - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 with: @@ -60,11 +65,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 env: - ARTIFACT_GROUP_ID: uk.potatolab MAVEN_USER: ${{ secrets.MAVEN_USER }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - ORG_GRADLE_PROJECT_tdlmUsername: ${{ secrets.MAVEN_USER }} - ORG_GRADLE_PROJECT_tdlmPassword: ${{ secrets.MAVEN_PASSWORD }} steps: - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 with: diff --git a/build.gradle b/build.gradle index 9a49f8a..6723a57 100644 --- a/build.gradle +++ b/build.gradle @@ -1,30 +1,4 @@ plugins { id 'com.gtnewhorizons.gtnhconvention' } -def gitCommit = providers.exec { - commandLine 'git', 'rev-parse', '--short=7', 'HEAD' -}.standardOutput.asText.get().trim() +version = providers.gradleProperty('modVersion').get() -group = 'uk.potatolab' -version = "${providers.gradleProperty('modVersion').get()}-${gitCommit}" - -afterEvaluate { - publishing.publications.named('maven', MavenPublication) { - groupId = project.group - artifactId = 'thaumicadditions' - version = project.version - } -} - -repositories { - maven { - name = 'TDLM Maven' - url = 'https://git.nest.potatolab.uk:8443/api/packages/TDLM/maven' - content { includeGroup "uk.potatolab" } - if (System.getenv('MAVEN_USER') && System.getenv('MAVEN_PASSWORD')) { - credentials { - username = System.getenv('MAVEN_USER') - password = System.getenv('MAVEN_PASSWORD') - } - } - } -} diff --git a/dependencies.gradle b/dependencies.gradle index f788b2b..5d3c410 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,20 +1,16 @@ repositories { mavenLocal() } -def tdlmDependencyVersion = { String artifact, String fallback -> - project.findProperty('tdlm.dependency.' + artifact.toLowerCase() + '.version') ?: fallback -} - dependencies { // Thaumcraft 4 full dev jar (api + common impl; the sources import thaumcraft.common.* and thaumcraft.client.*) - api("uk.potatolab:Thaumcraft4:${tdlmDependencyVersion('Thaumcraft4', '1.7.10-4.2.3.5-d3ece2a')}") + api("uk.potatolab:Thaumcraft4:1.7.10-4.2.3.5-d3ece2a") // cofh.api.energy.IEnergyReceiver is used by TileThaumicGenerator (the CoFH API lives in CoFHLib, not CoFHCore) - compileOnly("uk.potatolab:CoFHLib-1.7.10-Legacy:${tdlmDependencyVersion('CoFHLib-1.7.10-Legacy', '1.7.10R3.0.3-6ab2b0e')}") + compileOnly("uk.potatolab:CoFHLib-1.7.10-Legacy:1.7.10R3.0.3-6ab2b0e") // Botania API (com.pengu.thaumcraft.additions.api.others.Botania) - compileOnly("uk.potatolab:Botania:${tdlmDependencyVersion('Botania', '1.13.36-GTNH-722cecf')}:dev") { transitive = false } + compileOnly("uk.potatolab:Botania:1.13.36-GTNH-722cecf:dev") { transitive = false } // Waila API (com.pengu.thaumcraft.additions.api.others.WAILA) - compileOnly("uk.potatolab:Waila:${tdlmDependencyVersion('Waila', '1.19.30-5462a91')}:api") { transitive = false } + compileOnly("uk.potatolab:Waila:1.19.30-5462a91:api") { transitive = false } // Baubles is required at runtime (see the @Mod dependencies string); no compile-time import - runtimeOnly("uk.potatolab:Baubles-Expanded:${tdlmDependencyVersion('Baubles-Expanded', '44bd380')}") + runtimeOnly("uk.potatolab:Baubles-Expanded:44bd380") } diff --git a/gradle.properties b/gradle.properties index 8e7788c..b2008a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,4 +12,3 @@ disableSpotless = true disableCheckstyle = true org.gradle.jvmargs = -Xmx2G usesMavenPublishing = true -mavenPublishUrl = https://git.nest.potatolab.uk:8443/api/packages/TDLM/maven diff --git a/settings.gradle b/settings.gradle index 69feef3..1d215b4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,7 @@ pluginManagement { repositories { + // The organisation's registry (Stratum): stratum.resolveUrl in ~/.gradle/gradle.properties, or STRATUM_RESOLVE_URL in CI. + maven { url = providers.gradleProperty('stratum.resolveUrl').orElse(providers.environmentVariable('STRATUM_RESOLVE_URL')).get() } maven { name "GTNH Maven" url "https://nexus.gtnewhorizons.com/repository/public/" @@ -13,6 +15,14 @@ pluginManagement { mavenLocal() } } -plugins { id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29' } +plugins { + id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29' + id 'uk.potatolab.stratum' version '1.0.0-20261028.100932-g18e54b5' +} rootProject.name = 'thaumicadditions' + +// Published as uk.potatolab:ThaumicAdditions:--g, to the organisation's registry. +stratum { + artifactId = 'ThaumicAdditions' +} -- 2.47.3