Skip to content

Commit bd39655

Browse files
authored
update Jenkinsfile to release (#151)
* update Jenkinsfile to release * remove gha
1 parent 88e58df commit bd39655

File tree

2 files changed

+20
-76
lines changed

2 files changed

+20
-76
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

Jenkinsfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ pipeline {
1111
stage('Init') {
1212
steps {
1313
checkout scm
14+
script {
15+
def m = (env.GIT_URL =~ /(\/|:)(([^\/]+)\/)?(([^\/]+?)(\.git)?)$/)
16+
if (m) {
17+
org = m.group(3)
18+
repo = m.group(5)
19+
}
20+
}
1421
}
1522
}
1623
stage('Setup build') {
@@ -25,8 +32,9 @@ pipeline {
2532
when { buildingTag(); not { changeRequest() } }
2633
steps {
2734
script {
28-
target = "verify deploy -P release --settings settings.xml"
35+
target = "deploy -P release -P rpm --settings settings.xml"
2936
}
37+
sh 'gpg --batch --import arpnetworking.key'
3038
}
3139
}
3240
stage('Build') {
@@ -35,11 +43,21 @@ pipeline {
3543
usernamePassword(credentialsId: 'jenkins-ossrh', usernameVariable: 'OSSRH_USER', passwordVariable: 'OSSRH_PASS'),
3644
string(credentialsId: 'jenkins-gpg', variable: 'GPG_PASS')]) {
3745
withMaven {
38-
sh "./jdk-wrapper.sh ./mvnw clean $target -P rpm -U -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
46+
sh "./jdk-wrapper.sh ./mvnw $target -P rpm -U -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Ddocker.verbose=true"
3947
}
4048
}
4149
}
4250
}
51+
stage('GitHub release') {
52+
when { buildingTag(); not { changeRequest() } }
53+
steps {
54+
withCredentials([usernamePassword(credentialsId: 'brandonarp-github-token', usernameVariable: 'GITHUB_USERNAME', passwordVariable: 'GITHUB_TOKEN')]) {
55+
sh "github-release release --user ${org} --repo ${repo} --tag ${TAG_NAME}"
56+
sh "github-release upload --user ${org} --repo ${repo} --tag ${TAG_NAME} --name ${TAG_NAME}.tgz --file target/*.tgz"
57+
sh "github-release upload --user ${org} --repo ${repo} --tag ${TAG_NAME} --name ${TAG_NAME}.rpm --file target/rpm/*/RPMS/*/*.rpm"
58+
}
59+
}
60+
}
4361
}
4462
post('Analysis') {
4563
always {

0 commit comments

Comments
 (0)