GitLab CI: publish by job
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,6 +10,3 @@ out/
|
|||||||
.gradle/
|
.gradle/
|
||||||
build/
|
build/
|
||||||
publish.gradle
|
publish.gradle
|
||||||
|
|
||||||
# OTHER #
|
|
||||||
secrets.properties
|
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ build:
|
|||||||
stage: build
|
stage: build
|
||||||
only:
|
only:
|
||||||
- dev/ci
|
- dev/ci
|
||||||
script: gradle --console=plain compileJava
|
script: gradle --console=plain publish
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ plugins {
|
|||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
def secrets = new Properties()
|
|
||||||
file("secrets.properties").withInputStream { secrets.load(it) }
|
|
||||||
|
|
||||||
project.group = projectGroup
|
project.group = projectGroup
|
||||||
project.version = projectVersion
|
project.version = projectVersion
|
||||||
|
|
||||||
@@ -94,8 +91,8 @@ publishing {
|
|||||||
maven {
|
maven {
|
||||||
url "https://gitlab.com/api/v4/projects/${project.property('gitlab.projectid')}/packages/maven"
|
url "https://gitlab.com/api/v4/projects/${project.property('gitlab.projectid')}/packages/maven"
|
||||||
credentials(HttpHeaderCredentials) {
|
credentials(HttpHeaderCredentials) {
|
||||||
name = 'Private-Token'
|
name = 'Job-Token'
|
||||||
value = secrets.getProperty('gitlab.privateToken')
|
value = System.getenv('CI_JOB_TOKEN')
|
||||||
}
|
}
|
||||||
authentication {
|
authentication {
|
||||||
header(HttpHeaderAuthentication)
|
header(HttpHeaderAuthentication)
|
||||||
|
|||||||
Reference in New Issue
Block a user