This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Jenkinsfile
53 lines (48 loc) · 1.72 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
pipeline {
agent {
label 'android-reloaded-builder'
}
options {
parallelsAlwaysFailFast()
disableConcurrentBuilds()
}
parameters {
string(name: 'version', defaultValue: '1.1.4')
booleanParam(name: 'deploy', defaultValue: false)
}
stages {
stage('Build') {
agent {
dockerfile true
}
steps {
checkout scm
writeFile file: 'mk/version.mk', text: "VERSION := $version"
sh "rm -rf android/dist"
sh "cd android && make dist"
stash includes: 'android/dist/*', name: 'artifacts'
archiveArtifacts artifacts: 'android/dist/*', followSymlinks: false
}
}
stage('Upload to sonatype') {
when {
expression { return params.deploy }
}
steps {
withCredentials([ usernamePassword( credentialsId: 'android-sonatype-nexus', usernameVariable: 'SONATYPE_USERNAME', passwordVariable: 'SONATYPE_PASSWORD' ),
file(credentialsId: 'D599C1AA126762B1.asc', variable: 'PGP_PRIVATE_KEY_FILE'),
string(credentialsId: 'PGP_PASSPHRASE', variable: 'PGP_PASSPHRASE') ]) {
withMaven(maven: 'M3') {
unstash 'artifacts'
sh(
script: """
touch local.properties
version=$version ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
"""
)
}
}
}
}
}
}