use out for output, use CGO_ENABLED=1 and GO111MODULE=off for Android and iOS (#1574)

This commit is contained in:
Jakub Sokołowski 2019-08-20 03:05:15 -04:00 committed by Adam Babik
parent 8383feea04
commit 652d8a67b6
6 changed files with 25 additions and 13 deletions

View File

@ -211,8 +211,8 @@ release: check-existing-release
xgo-install:
go get -u github.com/karalabe/xgo
gomobile-install:
go get -u golang.org/x/mobile/cmd/gomobile
gomobile-install: xtools-install
go get golang.org/x/mobile/cmd/gomobile
release-install:
go get -u github.com/c4milo/github-release
@ -221,6 +221,10 @@ gen-install:
go get -u github.com/kevinburke/go-bindata/go-bindata@v3.13.0
go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.1
xtools-install:
# special fix for gomobile issues
go get golang.org/x/tools/go/packages
modvendor-install:
# a tool to vendor non-go files
go get -u github.com/goware/modvendor

View File

@ -31,7 +31,7 @@ pipeline {
GOPATH = "${env.WORKSPACE}"
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
/* This will override the var in Makefile */
RELEASE_DIR = "${env.WORKSPACE}/pkg"
RELEASE_DIR = "${env.WORKSPACE}/out"
}
stages {

View File

@ -27,6 +27,10 @@ pipeline {
}
environment {
/* fix for gomobile complaining about missing packages */
CGO_ENABLED = "1"
GO111MODULE = "off"
/* Other stuff */
BUILD_PLATFORM = 'android'
STATUS_PATH = "${env.WORKSPACE}/src/github.com/status-im/status-go"
CI_DIR = "${env.STATUS_PATH}/_assets/ci"
@ -47,7 +51,7 @@ pipeline {
println("Git Branch: ${lib.gitBranch()}")
println("Git Commit: ${lib.gitCommit()}")
/* save and create a dir for artifacts */
dest = "${env.WORKSPACE}/pkg"
dest = "${env.WORKSPACE}/out"
sh "mkdir -p ${dest}"
/* for easier reuse */
artifact = "status-go-android-${lib.suffix()}.aar"
@ -63,11 +67,11 @@ pipeline {
} } }
stage('Archive') { steps {
archiveArtifacts("pkg/${artifact}")
archiveArtifacts("out/${artifact}")
} }
stage('Upload') { steps { script {
env.PKG_URL = lib.uploadArtifact("pkg/${artifact}")
env.PKG_URL = lib.uploadArtifact("out/${artifact}")
} } }
} // stages
post {

View File

@ -27,6 +27,10 @@ pipeline {
}
environment {
/* fix for gomobile complaining about missing packages */
CGO_ENABLED = "1"
GO111MODULE = "off"
/* Other stuff */
BUILD_PLATFORM = 'ios'
STATUS_PATH = "${env.WORKSPACE}/src/github.com/status-im/status-go"
CI_DIR = "${env.STATUS_PATH}/_assets/ci"
@ -42,7 +46,7 @@ pipeline {
println("Git Branch: ${lib.gitBranch()}")
println("Git Commit: ${lib.gitCommit()}")
/* save and create a dir for artifacts */
dest = "${env.WORKSPACE}/pkg"
dest = "${env.WORKSPACE}/out"
sh "mkdir -p ${dest}"
/* for easier reuse */
artifact = "status-go-ios-${lib.suffix()}.zip"
@ -54,6 +58,7 @@ pipeline {
stage('Compile') { steps { dir(env.STATUS_PATH) {
sh 'make statusgo-ios'
sh 'go get golang.org/x/tools/go/packages'
dir('build/bin') {
sh 'zip -r status-go-ios.zip Statusgo.framework'
sh "cp status-go-ios.zip ${dest}/${artifact}"
@ -61,11 +66,11 @@ pipeline {
} } }
stage('Archive') { steps {
archiveArtifacts("pkg/${artifact}")
archiveArtifacts("out/${artifact}")
} }
stage('Upload') { steps { script {
env.PKG_URL = lib.uploadArtifact("pkg/${artifact}")
env.PKG_URL = lib.uploadArtifact("out/${artifact}")
} } }
} // stages
post {

View File

@ -42,7 +42,7 @@ pipeline {
println("Git Branch: ${lib.gitBranch()}")
println("Git Commit: ${lib.gitCommit()}")
/* save and create a dir for artifacts */
dest = "${env.WORKSPACE}/pkg"
dest = "${env.WORKSPACE}/out"
sh "mkdir -p ${dest}"
/* for easier reuse */
artifact = "status-go-desktop-${lib.suffix()}.zip"
@ -57,11 +57,11 @@ pipeline {
} } }
stage('Archive') { steps {
archiveArtifacts("pkg/${artifact}")
archiveArtifacts("out/${artifact}")
} }
stage('Upload') { steps { script {
env.PKG_URL = lib.uploadArtifact("pkg/${artifact}")
env.PKG_URL = lib.uploadArtifact("out/${artifact}")
} } }
} // stages
post {

View File

@ -76,7 +76,6 @@ pipeline {
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
always { dir(env.STATUS_PATH) {
sh 'make clean'
sh "rm -fr ${dest}"
} }
} // post
}