diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 27dba61..ea7b678 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,7 +48,13 @@ jobs: base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg - name: maven publish - run: ./gradlew build publish closeAndReleaseRepository -Psigning.keyId=${{secrets.NEXUS_GPG_SIGNING_KEY_ID}} -Psigning.password=${{ secrets.NEXUS_GPG_SECRET_KEY_PASSWORD }} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) + run: ./gradlew build publish -Psigning.keyId=${{secrets.NEXUS_GPG_SIGNING_KEY_ID}} -Psigning.password=${{ secrets.NEXUS_GPG_SECRET_KEY_PASSWORD }} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) env: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + + - name: hosting publish + run: ./gradlew build curseforge modrinth + env: + CURSEFORGE_API_KEY: ${{ secrets.CF_API_KEY }} + MODRINTH_API_KEY: ${{ secrets.MR_API_KEY }} diff --git a/fabric/build.gradle b/fabric/build.gradle index 835d0c1..04d3f95 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -77,9 +77,9 @@ tasks.withType(JavaCompile).configureEach { source(project(':common').sourceSets.main.allSource) } -if (hasProperty('curseForgeApiKey')) { +if (hasProperty('curseForgeApiKey') || System.getenv("CURSEFORGE_API_KEY") != null) { curseforge { - apiKey = curseForgeApiKey + apiKey = findProperty('curseForgeApiKey') ?: System.getenv("CURSEFORGE_API_KEY") project { id = '501373' changelog = changelogFile @@ -101,9 +101,9 @@ if (hasProperty('curseForgeApiKey')) { } } -if (hasProperty('modrinthApiKey')) { +if (hasProperty('modrinthApiKey') || System.getenv("MODRINTH_API_KEY") != null) { modrinth { - token = modrinthApiKey + token = findProperty('modrinthApiKey') ?: System.getenv("MODRINTH_API_KEY") projectId = 'RAXqYPH1' versionNumber = "$version+fabric" versionName = project.mod_version diff --git a/forge/build.gradle b/forge/build.gradle index 67d6cb4..078b4fd 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -113,9 +113,9 @@ jar { archiveClassifier.set('slim') } -if (hasProperty('curseForgeApiKey')) { +if (hasProperty('curseForgeApiKey') || System.getenv("CURSEFORGE_API_KEY") != null) { curseforge { - apiKey = curseForgeApiKey + apiKey = findProperty('curseForgeApiKey') ?: System.getenv("CURSEFORGE_API_KEY") project { id = '605980' changelog = changelogFile @@ -136,9 +136,9 @@ if (hasProperty('curseForgeApiKey')) { } } -if (hasProperty('modrinthApiKey')) { +if (hasProperty('modrinthApiKey') || System.getenv("MODRINTH_API_KEY") != null) { modrinth { - token = modrinthApiKey + token = findProperty('modrinthApiKey') ?: System.getenv("MODRINTH_API_KEY") projectId = 'RAXqYPH1' versionNumber.set(version) versionName = project.mod_version diff --git a/publish.sh b/publish.sh deleted file mode 100755 index 599532b..0000000 --- a/publish.sh +++ /dev/null @@ -1,2 +0,0 @@ -./gradlew build -./gradlew curseforge modrinth \ No newline at end of file