Add Linux and Windows cross-build
This commit is contained in:
Vendored
+30
-7
@@ -1,28 +1,51 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
options {
|
||||||
|
timestamps()
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: '10'))
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('Build Linux') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
echo "Building project..."
|
mkdir -p build/linux
|
||||||
mkdir -p build
|
g++ main.cpp -o build/linux/test_app
|
||||||
g++ main.cpp -o build/test_app
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Run') {
|
stage('Build Windows') {
|
||||||
steps {
|
steps {
|
||||||
sh '''
|
sh '''
|
||||||
./build/test_app
|
mkdir -p build/windows
|
||||||
|
x86_64-w64-mingw32-g++ main.cpp -o build/windows/test_app.exe
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Run Linux') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
./build/linux/test_app
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Package') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
cd build
|
||||||
|
tar -czf linux-build.tar.gz linux
|
||||||
|
zip -r windows-build.zip windows
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Archive') {
|
stage('Archive') {
|
||||||
steps {
|
steps {
|
||||||
archiveArtifacts artifacts: 'build/**', fingerprint: true
|
archiveArtifacts artifacts: 'build/linux-build.tar.gz, build/windows-build.zip', fingerprint: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user