Skip to content

Commit

Permalink
Add debug release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Kotori316 committed Nov 17, 2023
1 parent 54536e4 commit 2d2dd1b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 36 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/release_forge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -59,6 +59,7 @@ jobs:
-PjarSign.storePass="${JAR_PASSWORD}"
build publishToMavenLocal curseforge modrinth githubRelease publish -x test
env:
RELEASE_DEBUG: 'true'
REPO_TOKEN: ${{secrets.GITHUB_TOKEN}}
AZURE_TOKEN: ${{steps.get-secrets.outputs.azure_token}}
KEY_PASSWORD: ${{steps.get-secrets.outputs.key_password}}
Expand All @@ -74,7 +75,7 @@ jobs:
done
- name: Verify Main Jar
run: |
for f in $(ls build/libs/*.jar | grep -v "deobf" | grep -v "sources") ; do
for f in $(ls */build/libs/*.jar) ; do
echo "$f"
jarsigner -verify -keystore "${HOME}/kotori316_keystore.jks" "$f" -strict
done
Expand All @@ -90,4 +91,5 @@ jobs:
with:
name: SLP-Release-${{ github.run_number }}
path: |
build/libs/
*/build/libs/
~/.m2
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tasks.named("wrapper", Wrapper.class) {
gradleVersion = "8.4"
}

final boolean RELEASE_DEBUG = Boolean.parseBoolean(System.getenv("RELEASE_DEBUG") ?: "true")
githubRelease {
repo.set('SLP')
token = project.findProperty("githubToken") ?: System.getenv("REPO_TOKEN") ?: ""
Expand All @@ -32,5 +33,5 @@ githubRelease {
}
)
)
dryRun.set(false)
dryRun.set(RELEASE_DEBUG)
}
35 changes: 19 additions & 16 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ tasks.withType(JavaCompile).configureEach {
}

// ---------- Publish ----------
final boolean RELEASE_DEBUG = Boolean.parseBoolean(System.getenv("RELEASE_DEBUG") ?: "true")

curseforge {
apiKey = project.findProperty("curseforge_additional-enchanted-miner_key") ?: System.getenv("CURSE_TOKEN") ?: ""
Expand All @@ -209,8 +210,8 @@ curseforge {
addArtifact(tasks.jarJar)
}
options {
curseGradleOptions.debug = false // defaults to false
javaVersionAutoDetect = false
curseGradleOptions.debug = RELEASE_DEBUG // defaults to false
curseGradleOptions.javaVersionAutoDetect = false
}
}

Expand All @@ -227,25 +228,27 @@ modrinth {
gameVersions = ["1.20.2"]
loaders = ["forge"]
changelog = project.getChangelog()
debugMode = false
debugMode = RELEASE_DEBUG
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Kotori316/SLP")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") ?: ""
password = project.findProperty("githubToken") ?: System.getenv("REPO_TOKEN")
if(!RELEASE_DEBUG) {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Kotori316/SLP")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") ?: ""
password = project.findProperty("githubToken") ?: System.getenv("REPO_TOKEN")
}
}
}
maven {
name = "AzureRepository"
url = uri("https://pkgs.dev.azure.com/Kotori316/minecraft/_packaging/mods/maven/v1")
credentials {
username = project.findProperty("azureUserName") ?: System.getenv("AZURE_USER_NAME") ?: ""
password = project.findProperty("azureToken") ?: System.getenv("AZURE_TOKEN") ?: "TOKEN"
maven {
name = "AzureRepository"
url = uri("https://pkgs.dev.azure.com/Kotori316/minecraft/_packaging/mods/maven/v1")
credentials {
username = project.findProperty("azureUserName") ?: System.getenv("AZURE_USER_NAME") ?: ""
password = project.findProperty("azureToken") ?: System.getenv("AZURE_TOKEN") ?: "TOKEN"
}
}
}
if (System.getenv("CI") == null) {
Expand Down
34 changes: 18 additions & 16 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.util.function.Predicate

plugins {
id 'scala'
Expand Down Expand Up @@ -156,6 +155,7 @@ tasks.withType(JavaCompile).configureEach {
}

// ---------- Publish ----------
final boolean RELEASE_DEBUG = Boolean.parseBoolean(System.getenv("RELEASE_DEBUG") ?: "true")

curseforge {
apiKey = project.findProperty("curseforge_additional-enchanted-miner_key") ?: System.getenv("CURSE_TOKEN") ?: ""
Expand All @@ -172,7 +172,7 @@ curseforge {
addArtifact(tasks.jarJar)
}
options {
curseGradleOptions.debug = false // defaults to false
curseGradleOptions.debug = RELEASE_DEBUG // defaults to false
curseGradleOptions.javaVersionAutoDetect = false
curseGradleOptions.forgeGradleIntegration = false
}
Expand All @@ -191,25 +191,27 @@ modrinth {
gameVersions = ["1.20.2"]
loaders = ["neoforge"]
changelog = project.getChangelog()
debugMode = false
debugMode = RELEASE_DEBUG
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Kotori316/SLP")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") ?: ""
password = project.findProperty("githubToken") ?: System.getenv("REPO_TOKEN")
if (!RELEASE_DEBUG) {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Kotori316/SLP")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR") ?: ""
password = project.findProperty("githubToken") ?: System.getenv("REPO_TOKEN")
}
}
}
maven {
name = "AzureRepository"
url = uri("https://pkgs.dev.azure.com/Kotori316/minecraft/_packaging/mods/maven/v1")
credentials {
username = project.findProperty("azureUserName") ?: System.getenv("AZURE_USER_NAME") ?: ""
password = project.findProperty("azureToken") ?: System.getenv("AZURE_TOKEN") ?: "TOKEN"
maven {
name = "AzureRepository"
url = uri("https://pkgs.dev.azure.com/Kotori316/minecraft/_packaging/mods/maven/v1")
credentials {
username = project.findProperty("azureUserName") ?: System.getenv("AZURE_USER_NAME") ?: ""
password = project.findProperty("azureToken") ?: System.getenv("AZURE_TOKEN") ?: "TOKEN"
}
}
}
if (System.getenv("CI") == null) {
Expand Down

0 comments on commit 2d2dd1b

Please sign in to comment.