GitLab CI: manual publish
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,3 +10,6 @@ out/
|
||||
.gradle/
|
||||
build/
|
||||
publish.gradle
|
||||
|
||||
# OTHER #
|
||||
secrets.properties
|
||||
|
||||
36
build.gradle
36
build.gradle
@@ -1,11 +1,11 @@
|
||||
//file:noinspection GroovyAssignabilityCheck
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
def publishScript = file(rootProject.getProjectDir().getPath() + '/publish.gradle')
|
||||
if (publishScript.exists()) {
|
||||
apply from: publishScript.path
|
||||
}
|
||||
def secrets = new Properties()
|
||||
file("secrets.properties").withInputStream { secrets.load(it) }
|
||||
|
||||
project.group = projectGroup
|
||||
project.version = projectVersion
|
||||
@@ -15,6 +15,7 @@ repositories {
|
||||
mavenCentral()
|
||||
maven { url 'https://hub.spigotmc.org/nexus/content/groups/public' }
|
||||
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 {
|
||||
@@ -76,4 +77,29 @@ dependencies {
|
||||
|
||||
test {
|
||||
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
|
||||
projectName=ghast-tools
|
||||
projectVersion=1.12.1
|
||||
projectVersion=1.12.1
|
||||
|
||||
gitlab.projectid=23328133
|
||||
Reference in New Issue
Block a user