diff --git a/.github/requirements.txt b/.github/requirements.txt index 2ea94aa1d..df821f8d5 100644 --- a/.github/requirements.txt +++ b/.github/requirements.txt @@ -1 +1,2 @@ -fire==0.4.0 \ No newline at end of file +fire==0.4.0 +curseuploadpy @ git+https://github.com/MrTJP/curseuploadpy.git@dev diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 616d2aee9..ce3d864d7 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -129,9 +129,41 @@ jobs: - name: Curse publish if: ${{ steps.release_type.outputs.publish_curse == 'true' }} - run: ./gradlew curseforge + run: | + # Base args for all modules + COMMON_ARGS=( \ + -k $CURSE_TOKEN \ + -rt $CURSE_RELEASE_TYPE \ + -v 'Java 17' \ + -v 1.20.1 \ + -v Forge \ + -c ./CHANGELOG.md \ + --required-dep codechicken-lib-1-8 \ + --required-dep cb-multipart \ + ) + + # All submodules need PR Core + MODULE_ARGS=( \ + "${COMMON_ARGS[@]}" \ + --required-dep project-red-core \ + ) + + # Fabrication is special and also needs Integration and Transmission + FAB_ARGS=( \ + "${MODULE_ARGS[@]}" \ + --required-dep project-red-integration \ + --required-dep project-red-transmission \ + ) + + python -m curseuploadpy "${COMMON_ARGS[@]}" -p 228702 -f core/build/libs/*-core.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229048 -f expansion/build/libs/*-expansion.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229049 -f exploration/build/libs/*-exploration.jar + python -m curseuploadpy "${FAB_ARGS[@]}" -p 230111 -f fabrication/build/libs/*-fabrication.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229046 -f illumination/build/libs/*-illumination.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229045 -f integration/build/libs/*-integration.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 478939 -f transmission/build/libs/*-transmission.jar + env: - AUTO_GENERATED_VERSION: ${{ steps.versioning.outputs.version }} CURSE_RELEASE_TYPE: ${{ steps.release_type.outputs.release_type }} CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }} diff --git a/.github/workflows/verify-pull-request.yaml b/.github/workflows/verify-pull-request.yaml index 3dccf8399..d42dec1b2 100644 --- a/.github/workflows/verify-pull-request.yaml +++ b/.github/workflows/verify-pull-request.yaml @@ -25,6 +25,7 @@ jobs: build_test: name: Build and Test runs-on: ubuntu-latest + environment: prod steps: - name: Checkout git repo uses: actions/checkout@v3 @@ -91,3 +92,46 @@ jobs: with: name: project-red-${{ steps.versioning.outputs.version }} path: '*/build/libs/ProjectRed-*.jar' + + - name: TEST curseforgepy + continue-on-error: true + run: | + # Base args for all modules + COMMON_ARGS=( \ + -k $CURSE_TOKEN \ + -rt $CURSE_RELEASE_TYPE \ + -v 'Java 17' \ + -v 1.20.4 \ + -v NeoForge \ + -c ./CHANGELOG.md \ + --required-dep codechicken-lib-1-8 \ + --required-dep cb-multipart \ + --dryrun \ + ) + + # All submodules need PR Core + MODULE_ARGS=( \ + "${COMMON_ARGS[@]}" \ + --required-dep project-red-core \ + ) + + # Fabrication is special and also needs Integration and Transmission + FAB_ARGS=( \ + "${MODULE_ARGS[@]}" \ + --required-dep project-red-integration \ + --required-dep project-red-transmission \ + ) + + echo "# CHANGELOG \n ## ${GITHUB_SHA} \n" > ./CHANGELOG.md + + python -m curseuploadpy "${COMMON_ARGS[@]}" -p 228702 -f core/build/libs/*-core.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229048 -f expansion/build/libs/*-expansion.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229049 -f exploration/build/libs/*-exploration.jar + python -m curseuploadpy "${FAB_ARGS[@]}" -p 230111 -f fabrication/build/libs/*-fabrication.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229046 -f illumination/build/libs/*-illumination.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 229045 -f integration/build/libs/*-integration.jar + python -m curseuploadpy "${MODULE_ARGS[@]}" -p 478939 -f transmission/build/libs/*-transmission.jar + + env: + CURSE_RELEASE_TYPE: alpha + CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }} diff --git a/core/build.gradle b/core/build.gradle index 3519c25f9..415415773 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.neoforged.gradle' - id 'com.matthewprenger.cursegradle' } String mod_id = 'projectred_core' @@ -46,23 +45,3 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2' } - -curseforge { - apiKey = System.getenv('CURSE_TOKEN') ?: 'XXX' - - // Core - project { - id = '228702' - releaseType = System.getenv('CURSE_RELEASE_TYPE') ?: 'alpha' - changelogType = 'markdown' - changelog = rootProject.file('CHANGELOG.md') - relations { - requiredDependency 'codechicken-lib-1-8' // CCL is required for everything - requiredDependency 'cb-multipart' // CBMultipart is required for everything - } - - // Java/ForgeGradle integrations don't work after 1.18.2 port - addGameVersion "${mc_version}" - addGameVersion "Java ${java_lang_version}" - } -} diff --git a/expansion/build.gradle b/expansion/build.gradle index a86950e82..ffe280382 100644 --- a/expansion/build.gradle +++ b/expansion/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.neoforged.gradle' - id 'com.matthewprenger.cursegradle' id 'org.spongepowered.mixin' } @@ -45,22 +44,3 @@ mixin { debug.verbose = true debug.export = true } - -curseforge { - apiKey = System.getenv('CURSE_TOKEN') ?: 'XXX' - - // Expansion - project { - id = '229048' - releaseType = System.getenv('CURSE_RELEASE_TYPE') ?: 'alpha' - changelogType = 'markdown' - changelog = rootProject.file('CHANGELOG.md') - relations { - requiredDependency 'project-red-core' - } - - // Java/ForgeGradle integrations don't work after 1.18.2 port - addGameVersion "${mc_version}" - addGameVersion "Java ${java_lang_version}" - } -} \ No newline at end of file diff --git a/exploration/build.gradle b/exploration/build.gradle index 8dd43a102..2ff8a0dfd 100644 --- a/exploration/build.gradle +++ b/exploration/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.neoforged.gradle' - id 'com.matthewprenger.cursegradle' } String mod_id = 'projectred_exploration' @@ -33,22 +32,3 @@ dependencies { implementation project(":core") } - -curseforge { - apiKey = System.getenv('CURSE_TOKEN') ?: 'XXX' - - // Exploration - project { - id = '229049' - releaseType = System.getenv('CURSE_RELEASE_TYPE') ?: 'alpha' - changelogType = 'markdown' - changelog = rootProject.file('CHANGELOG.md') - relations { - requiredDependency 'project-red-core' - } - - // Java/ForgeGradle integrations don't work after 1.18.2 port - addGameVersion "${mc_version}" - addGameVersion "Java ${java_lang_version}" - } -} \ No newline at end of file diff --git a/fabrication/build.gradle b/fabrication/build.gradle index a68797851..b53e100ee 100644 --- a/fabrication/build.gradle +++ b/fabrication/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.neoforged.gradle' - id 'com.matthewprenger.cursegradle' id 'com.github.johnrengelman.shadow' } @@ -58,24 +57,3 @@ reobf { jar { enabled = false } // Disable unshaded jar shadowJar { } // Enable shadow jar reobf } - -curseforge { - apiKey = System.getenv('CURSE_TOKEN') ?: 'XXX' - - // Fabrication - project { - id = '230111' - releaseType = System.getenv('CURSE_RELEASE_TYPE') ?: 'alpha' - changelogType = 'markdown' - changelog = rootProject.file('CHANGELOG.md') - relations { - requiredDependency 'project-red-core' - requiredDependency 'project-red-integration' - requiredDependency 'project-red-transmission' - } - - // Java/ForgeGradle integrations don't work after 1.18.2 port - addGameVersion "${mc_version}" - addGameVersion "Java ${java_lang_version}" - } -} diff --git a/illumination/build.gradle b/illumination/build.gradle index d91412ae5..ac1cc6d87 100644 --- a/illumination/build.gradle +++ b/illumination/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.neoforged.gradle' - id 'com.matthewprenger.cursegradle' } String mod_id = 'projectred_illumination' @@ -33,22 +32,3 @@ dependencies { implementation project(":core") } - -curseforge { - apiKey = System.getenv('CURSE_TOKEN') ?: 'XXX' - - // Illumination - project { - id = '229046' - releaseType = System.getenv('CURSE_RELEASE_TYPE') ?: 'alpha' - changelogType = 'markdown' - changelog = rootProject.file('CHANGELOG.md') - relations { - requiredDependency 'project-red-core' - } - - // Java/ForgeGradle integrations don't work after 1.18.2 port - addGameVersion "${mc_version}" - addGameVersion "Java ${java_lang_version}" - } -} \ No newline at end of file diff --git a/integration/build.gradle b/integration/build.gradle index 4510719c0..0b2df6dc8 100644 --- a/integration/build.gradle +++ b/integration/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.neoforged.gradle' - id 'com.matthewprenger.cursegradle' } String mod_id = 'projectred_integration' @@ -33,22 +32,3 @@ dependencies { implementation project(":core") } - -curseforge { - apiKey = System.getenv('CURSE_TOKEN') ?: 'XXX' - - // Integration - project { - id = '229045' - releaseType = System.getenv('CURSE_RELEASE_TYPE') ?: 'alpha' - changelogType = 'markdown' - changelog = rootProject.file('CHANGELOG.md') - relations { - requiredDependency 'project-red-core' - } - - // Java/ForgeGradle integrations don't work after 1.18.2 port - addGameVersion "${mc_version}" - addGameVersion "Java ${java_lang_version}" - } -} diff --git a/settings.gradle b/settings.gradle index 11d53add0..b02693b7a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,7 +9,6 @@ pluginManagement { id 'java' id 'maven-publish' id 'net.covers1624.signing' version '1.1.3' apply false - id 'com.matthewprenger.cursegradle' version '1.4.0' apply false id 'net.neoforged.gradle' version '[6.0.18,6.2)' apply false id 'org.spongepowered.mixin' version '0.7.+' apply false id 'com.github.johnrengelman.shadow' version '7.1.+' apply false diff --git a/transmission/build.gradle b/transmission/build.gradle index cbd9a4452..19c6f9588 100644 --- a/transmission/build.gradle +++ b/transmission/build.gradle @@ -1,6 +1,5 @@ plugins { id 'net.neoforged.gradle' - id 'com.matthewprenger.cursegradle' } String mod_id = 'projectred_transmission' @@ -33,22 +32,3 @@ dependencies { implementation project(":core") } - -curseforge { - apiKey = System.getenv('CURSE_TOKEN') ?: 'XXX' - - // Transmission - project { - id = '478939' - releaseType = System.getenv('CURSE_RELEASE_TYPE') ?: 'alpha' - changelogType = 'markdown' - changelog = rootProject.file('CHANGELOG.md') - relations { - requiredDependency 'project-red-core' - } - - // Java/ForgeGradle integrations don't work after 1.18.2 port - addGameVersion "${mc_version}" - addGameVersion "Java ${java_lang_version}" - } -} \ No newline at end of file