0

GitLab CI: publish by job

This commit is contained in:
2021-10-21 22:24:23 +03:00
parent f923f47765
commit 2b055062a3
3 changed files with 3 additions and 9 deletions

3
.gitignore vendored
View File

@@ -10,6 +10,3 @@ out/
.gradle/
build/
publish.gradle
# OTHER #
secrets.properties

View File

@@ -8,4 +8,4 @@ build:
stage: build
only:
- dev/ci
script: gradle --console=plain compileJava
script: gradle --console=plain publish

View File

@@ -4,9 +4,6 @@ plugins {
id 'maven-publish'
}
def secrets = new Properties()
file("secrets.properties").withInputStream { secrets.load(it) }
project.group = projectGroup
project.version = projectVersion
@@ -94,8 +91,8 @@ publishing {
maven {
url "https://gitlab.com/api/v4/projects/${project.property('gitlab.projectid')}/packages/maven"
credentials(HttpHeaderCredentials) {
name = 'Private-Token'
value = secrets.getProperty('gitlab.privateToken')
name = 'Job-Token'
value = System.getenv('CI_JOB_TOKEN')
}
authentication {
header(HttpHeaderAuthentication)