add desktop build step

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-12-06 13:22:18 +01:00 committed by Jakub
parent b676de9dac
commit 7d651afaae
2 changed files with 38 additions and 31 deletions

View File

@ -219,8 +219,8 @@ prepare-release: clean-release
mkdir -p $(RELEASE_DIRECTORY) mkdir -p $(RELEASE_DIRECTORY)
mv build/bin/statusgo-android-16.aar $(RELEASE_DIRECTORY)/status-go-android.aar mv build/bin/statusgo-android-16.aar $(RELEASE_DIRECTORY)/status-go-android.aar
mv build/bin/statusgo-ios-9.3-framework/status-go-ios.zip $(RELEASE_DIRECTORY)/status-go-ios.zip mv build/bin/statusgo-ios-9.3-framework/status-go-ios.zip $(RELEASE_DIRECTORY)/status-go-ios.zip
${MAKE} clean
zip -r $(RELEASE_DIRECTORY)/status-go-desktop.zip . -x *.git* zip -r $(RELEASE_DIRECTORY)/status-go-desktop.zip . -x *.git*
${MAKE} clean
clean-release: clean-release:
rm -rf $(RELEASE_DIRECTORY) rm -rf $(RELEASE_DIRECTORY)

View File

@ -30,8 +30,13 @@ pipeline {
stage('Prep') { stage('Prep') {
steps { script { steps { script {
lib = load("${env.STATUS_PATH}/_assets/ci/lib.groovy") lib = load("${env.STATUS_PATH}/_assets/ci/lib.groovy")
version = readFile("${STATUS_PATH}/VERSION").trim()
println("Version: ${version}")
println("Git Branch: ${lib.gitBranch()}") println("Git Branch: ${lib.gitBranch()}")
println("Git Commit: ${lib.gitCommit()}") println("Git Commit: ${lib.gitCommit()}")
/* save and create a dir for artifacts */
dest = "${env.WORKSPACE}/pkg"
sh "mkdir -p ${dest}"
} } } }
} }
stage('Setup') { steps { dir(env.STATUS_PATH) { stage('Setup') { steps { dir(env.STATUS_PATH) {
@ -47,19 +52,13 @@ pipeline {
stages { stages {
stage('Compile') { steps { dir(env.STATUS_PATH) { stage('Compile') { steps { dir(env.STATUS_PATH) {
sh 'make statusgo-android' sh 'make statusgo-android'
sh "cp build/bin/statusgo-android-16.aar ${dest}/status-go-android-${lib.suffix()}.aar"
} } } } } }
stage('Archive') { steps { stage('Archive') { steps {
sh """ archiveArtifacts("pkg/status-go-android-${lib.suffix()}.aar")
cp ${env.STATUS_PATH}/build/bin/statusgo-android-16.aar \
${env.WORKSPACE}/status-go-android-${lib.suffix()}.aar
"""
archiveArtifacts("status-go-android-${lib.suffix()}.aar")
} } } }
stage('Upload') { steps { script { stage('Upload') { steps { script {
lib.uploadArtifact("status-go-android-${lib.suffix()}.aar") lib.uploadArtifact("pkg/status-go-android-${lib.suffix()}.aar")
} } }
stage('Cleanup') { steps { script {
sh "rm -f ${env.WORKSPACE}/*.aar"
} } } } } }
} }
} }
@ -69,40 +68,48 @@ pipeline {
sh 'make statusgo-ios-simulator' sh 'make statusgo-ios-simulator'
dir('build/bin/statusgo-ios-9.3-framework') { dir('build/bin/statusgo-ios-9.3-framework') {
sh 'zip -r status-go-ios.zip Statusgo.framework' sh 'zip -r status-go-ios.zip Statusgo.framework'
sh "cp status-go-ios.zip ${dest}/status-go-ios-${lib.suffix()}.zip"
} }
} } } } } }
stage('Archive') { steps { stage('Archive') { steps {
sh """ archiveArtifacts("pkg/status-go-ios-${lib.suffix()}.zip")
cp ${env.STATUS_PATH}/build/bin/statusgo-ios-9.3-framework/status-go-ios.zip \
${env.WORKSPACE}/status-go-ios-${lib.suffix()}.zip
"""
archiveArtifacts("status-go-ios-${lib.suffix()}.zip")
} } } }
stage('Upload') { steps { script { stage('Upload') { steps { script {
lib.uploadArtifact("status-go-ios-${lib.suffix()}.zip") lib.uploadArtifact("pkg/status-go-ios-${lib.suffix()}.zip")
} } } } } }
stage('Cleanup') { steps { script { }
sh "rm -f ${env.WORKSPACE}/*.zip" }
stage('Desktop') {
stages {
stage('Prepare') { steps { dir(env.STATUS_PATH) {
sh "zip -r ${dest}/status-go-desktop-${lib.suffix()}.zip . -x *.git"
} } }
stage('Archive') { steps {
archiveArtifacts("pkg/status-go-desktop-${lib.suffix()}.zip")
} }
stage('Upload') { steps { script {
lib.uploadArtifact("pkg/status-go-desktop-${lib.suffix()}.zip")
} } } } } }
} }
} }
} }
} }
stage('Release') { when { expression { params.RELEASE == true } } stage('Release') { when { expression { params.RELEASE == true } }
steps { steps { dir(env.STATUS_PATH) {
dir(env.STATUS_PATH) { sh 'make prepare-release'
sh 'make prepare-release' withCredentials([[
withCredentials([[ $class: 'UsernamePasswordMultiBinding',
$class: 'UsernamePasswordMultiBinding', credentialsId: 'status-im-auto',
credentialsId: 'status-im-auto', usernameVariable: 'GITHUB_USER',
usernameVariable: 'GITHUB_USER', passwordVariable: 'GITHUB_TOKEN'
passwordVariable: 'GITHUB_TOKEN' ]]) {
]]) { sh "yes | make release RELEASE_BRANCH=${lib.gitBranch()}"
sh "yes | make release RELEASE_BRANCH=${lib.gitBranch()}"
}
sh 'make clean-release'
} }
} sh 'make clean-release'
} }
} }
stage('Cleanup') { steps { script {
sh "rm -fr ${dest}"
} } }
} }
} }