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/ .gradle/
build/ build/
publish.gradle publish.gradle
# OTHER #
secrets.properties

View File

@@ -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

View File

@@ -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)