Skip to content

Commit

Permalink
oops: actually put maven publishing stuff in build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuclearfarts authored and Nuclearfarts committed Nov 5, 2020
1 parent 984a36d commit a9a763c
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ plugins {
id 'net.minecrell.licenser' version '0.4.1'
}

ext {
secretsPresent = false
release = true
}

// published snapshot builds
if (file('secrets.gradle').exists()) {
apply from: 'secrets.gradle'
project.ext.secretsPresent = true;
}

// add -SNAPSHOT if not releasing via GH Actions.
// (if manual release is necessary, change condition on if statement in publishing repos block, along with username+password fields)
if (System.getenv("MAVEN_PASS") == null) {
project.module_version += "-SNAPSHOT";
project.ext.release = false;
}

repositories {
maven {
name "WovenMC"
Expand Down Expand Up @@ -153,6 +171,25 @@ publishing {

repositories {
mavenLocal()
// TODO: add maven
if(project.ext.secretsPresent) {
maven {
url "https://maven.wovenmc.net/repository/maven-snapshots/"
name "snapshots"
credentials {
username project.ext.mavenUser
password project.ext.mavenPass
}
}
}
if(project.ext.release) {
maven {
url "https://maven.wovenmc.net/repository/maven-releases/"
name "releases"
credentials {
username "wovenuploads"
password System.getenv("MAVEN_PASS")
}
}
}
}
}

0 comments on commit a9a763c

Please sign in to comment.