GitLab CI: manual publish
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,3 +10,6 @@ out/
|
|||||||
.gradle/
|
.gradle/
|
||||||
build/
|
build/
|
||||||
publish.gradle
|
publish.gradle
|
||||||
|
|
||||||
|
# OTHER #
|
||||||
|
secrets.properties
|
||||||
|
|||||||
36
build.gradle
36
build.gradle
@@ -1,11 +1,11 @@
|
|||||||
|
//file:noinspection GroovyAssignabilityCheck
|
||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'java'
|
||||||
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
def publishScript = file(rootProject.getProjectDir().getPath() + '/publish.gradle')
|
def secrets = new Properties()
|
||||||
if (publishScript.exists()) {
|
file("secrets.properties").withInputStream { secrets.load(it) }
|
||||||
apply from: publishScript.path
|
|
||||||
}
|
|
||||||
|
|
||||||
project.group = projectGroup
|
project.group = projectGroup
|
||||||
project.version = projectVersion
|
project.version = projectVersion
|
||||||
@@ -15,6 +15,7 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://hub.spigotmc.org/nexus/content/groups/public' }
|
maven { url 'https://hub.spigotmc.org/nexus/content/groups/public' }
|
||||||
maven { url 'https://dmx-mc-project.gitlab.io/maven-repository/' }
|
maven { url 'https://dmx-mc-project.gitlab.io/maven-repository/' }
|
||||||
|
maven { url "https://gitlab.com/api/v4/projects/${project.property('gitlab.projectid')}/packages/maven" }
|
||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
@@ -76,4 +77,29 @@ dependencies {
|
|||||||
|
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
mavenBinary(MavenPublication) {
|
||||||
|
groupId = project.property('projectGroup')
|
||||||
|
artifactId = project.property('projectName')
|
||||||
|
version = project.property('projectVersion')
|
||||||
|
|
||||||
|
from components.java
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url "https://gitlab.com/api/v4/projects/${project.property('gitlab.projectid')}/packages/maven"
|
||||||
|
credentials(HttpHeaderCredentials) {
|
||||||
|
name = 'Private-Token'
|
||||||
|
value = secrets.getProperty('gitlab.privateToken')
|
||||||
|
}
|
||||||
|
authentication {
|
||||||
|
header(HttpHeaderAuthentication)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
projectGroup=ghast
|
projectGroup=ghast
|
||||||
projectName=ghast-tools
|
projectName=ghast-tools
|
||||||
projectVersion=1.12.1
|
projectVersion=1.12.1
|
||||||
|
|
||||||
|
gitlab.projectid=23328133
|
||||||
Reference in New Issue
Block a user