diff --git a/Jenkinsfile.release b/Jenkinsfile.release index 9e92384a4b..325b6423d3 100644 --- a/Jenkinsfile.release +++ b/Jenkinsfile.release @@ -63,13 +63,17 @@ node ('macos1'){ } stage('Build (iOS)') { - def build_no = sh(returnStdout: true, script: 'git rev-list --count HEAD').trim() + def build_no = sh(returnStdout: true, script: './build_no.sh').trim() sh ('plutil -replace CFBundleShortVersionString -string ' + version + ' ios/StatusIm/Info.plist') sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist') sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive' sh 'xcodebuild -exportArchive -exportPath status -archivePath status.xcarchive -exportOptionsPlist ~/archive.plist' } + stage('Push Build Tag') { + sh ('git push --tags') + } + stage('Deploy (Android)') { def artifact_dir = pwd() + '/android/app/build/outputs/apk/release/' println (artifact_dir + 'app-release.apk') diff --git a/Jenkinsfile.upload_release b/Jenkinsfile.upload_release index 93bfb0dda4..492acef9b3 100644 --- a/Jenkinsfile.upload_release +++ b/Jenkinsfile.upload_release @@ -66,7 +66,7 @@ node ('macos1'){ stage('Build (iOS)') { withCredentials([string(credentialsId: 'jenkins_pass', variable: 'password')]) { - def build_no = sh(returnStdout: true, script: 'git rev-list --count HEAD').trim() + def build_no = sh(returnStdout: true, script: './build_no.sh').trim() sh ('plutil -replace CFBundleShortVersionString -string ' + version + ' ios/StatusIm/Info.plist') sh ('plutil -replace CFBundleVersion -string ' + build_no + ' ios/StatusIm/Info.plist') sh 'export RCT_NO_LAUNCH_PACKAGER=true && xcodebuild -workspace ios/StatusIm.xcworkspace -scheme StatusIm -configuration release -archivePath status clean archive' @@ -75,6 +75,10 @@ node ('macos1'){ } } + stage('Push build tag') { + sh ('git push --tags') + } + stage('Deploy (Android)') { sh ('bundle exec fastlane android release || exit 0') } diff --git a/android/app/build.gradle b/android/app/build.gradle index 93ad2080a0..4f4b9c66f5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,7 +98,7 @@ def enableProguardInReleaseBuilds = false def getVersionCode = { -> new ByteArrayOutputStream().withStream { stdOut -> exec { - commandLine "git", "rev-list", "--count", "HEAD" + commandLine "./build_no.sh" standardOutput = stdOut } return stdOut.toString().toInteger() diff --git a/build_no.sh b/build_no.sh old mode 100644 new mode 100755