Add Linux and Windows cross-build

This commit is contained in:
2026-05-01 21:32:01 +03:00
parent 350a41484e
commit 5fb80c783f
Vendored
+30 -7
View File
@@ -1,28 +1,51 @@
pipeline {
agent any
options {
timestamps()
buildDiscarder(logRotator(numToKeepStr: '10'))
}
stages {
stage('Build') {
stage('Build Linux') {
steps {
sh '''
echo "Building project..."
mkdir -p build
g++ main.cpp -o build/test_app
mkdir -p build/linux
g++ main.cpp -o build/linux/test_app
'''
}
}
stage('Run') {
stage('Build Windows') {
steps {
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') {
steps {
archiveArtifacts artifacts: 'build/**', fingerprint: true
archiveArtifacts artifacts: 'build/linux-build.tar.gz, build/windows-build.zip', fingerprint: true
}
}
}