Skip to content

Commit

Permalink
Enable CF/MR publishing via workflow, remove closeAndReleaseRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Fireplace committed Jul 8, 2024
1 parent 671e1cf commit a3e471f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
8 changes: 4 additions & 4 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions publish.sh

This file was deleted.

0 comments on commit a3e471f

Please sign in to comment.