Configure version var for CI
All checks were successful
JCS-Prod/RSE-Model/pipeline/head This commit looks good

This commit is contained in:
JackCarterSmith 2022-07-27 20:14:08 +02:00
parent 6bfecbec01
commit 9af42fe692
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
2 changed files with 16 additions and 12 deletions

View File

@ -10,7 +10,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
# define project
add_definitions(-DCONF_NO_GL)
if(DEFINED ENV{CI})
project(rse-model VERSION 1.0.0.$ENV{CI_BUILD_NUMBER} DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C)
project(rse-model VERSION $ENV{CI_VERSION}.$ENV{CI_BUILD_NUMBER} DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C)
set(RSE_MOD_NAME $ENV{CI_OUTPUT_NAME}-${PROJECT_VERSION})
else()
project(rse-model VERSION 1.0.0 DESCRIPTION "RogueSquadron Extractor - Model" LANGUAGES C)

24
Jenkinsfile vendored
View File

@ -4,7 +4,8 @@ pipeline {
skipDefaultCheckout(true)
}
environment {
CI_OUTPUT_NAME = "RSE_Texture"
CI_OUTPUT_NAME = "RSE_Model"
CI_VERSION = "1.0.0"
CI_BUILD_NUMBER = "$BUILD_NUMBER"
}
stages {
@ -19,7 +20,8 @@ pipeline {
parallel(
linux: {
dir("linux") {
checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Texture'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Texture.git']]])
checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Model'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Model.git']]])
sh 'git submodule update --init --recursive'
dir("build") {
rtConanRun(clientId: "conan", command: "install .. --build missing")
}
@ -28,8 +30,9 @@ pipeline {
},
windows: {
dir("windows") {
checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Texture'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Texture.git']]])
dir("build") {
checkout([$class: 'GitSCM', branches: [[name: '**']], browser: [$class: 'GiteaBrowser', repoUrl: 'https://git.jcsmith.fr/JCS-Prod/RSE-Model'], extensions: [], userRemoteConfigs: [[credentialsId: 'jenkins-ssh', url: 'ssh://git@git.jcsmith.fr:2322/JCS-Prod/RSE-Model.git']]])
sh 'git submodule update --init --recursive'
dir("build") {
rtConanRun(clientId: "conan", command: "install .. --profile windows --build missing")
}
cmakeBuild buildDir: 'build', cmakeArgs: '-DGNU_HOST=x86_64-w64-mingw32 -DCMAKE_TOOLCHAIN_FILE=../mingw_cross_toolchain.cmake', installation: 'latest', steps: [[args: 'all']]
@ -41,15 +44,16 @@ pipeline {
stage('Deploy') {
steps {
dir("zip_linux") {
sh 'cp ../linux/build/${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}* .'
sh 'cp ../linux/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* .'
}
dir("zip_win") {
sh 'cp ../windows/build/${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}* ../windows/build/*.dll .'
// sh 'cp ../windows/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* ../windows/build/*.dll .'
sh 'cp ../windows/build/${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}* .'
}
zip archive: false, dir: 'zip_linux', exclude: '', glob: '', zipFile: 'x64.zip'
sh 'mv x64.zip ${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}_x64.zip'
sh 'mv x64.zip ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_x64.zip'
zip archive: false, dir: 'zip_win', exclude: '', glob: '', zipFile: 'mingw64.zip'
sh 'mv mingw64.zip ${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}_mingw64.zip'
sh 'mv mingw64.zip ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip'
archiveArtifacts(artifacts: '*.zip')
fingerprint(targets: '*.zip')
}
@ -57,8 +61,8 @@ pipeline {
stage('Sign') {
steps {
sh 'ls -l'
sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}_x64.zip.gpg ${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}_x64.zip'
sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}_mingw64.zip.gpg ${CI_OUTPUT_NAME}-1.0.1.${BUILD_NUMBER}_mingw64.zip'
sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_x64.zip.gpg ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_x64.zip'
sh 'gpg --batch --detach-sign -o ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip.gpg ${CI_OUTPUT_NAME}-${CI_VERSION}.${BUILD_NUMBER}_mingw64.zip'
archiveArtifacts(artifacts: '*.gpg')
fingerprint(targets: '*.gpg')
}