134 lines
No EOL
3.1 KiB
Groovy
134 lines
No EOL
3.1 KiB
Groovy
pipeline {
|
|
agent any
|
|
|
|
options {
|
|
buildDiscarder (
|
|
logRotator(
|
|
numToKeepStr: '5'
|
|
)
|
|
)
|
|
}
|
|
|
|
stages {
|
|
stage("Compile Windows") {
|
|
agent {
|
|
label 'windows'
|
|
}
|
|
|
|
steps {
|
|
script {
|
|
bat 'mkdir out'
|
|
bat 'flutter pub get'
|
|
bat 'flutter build windows'
|
|
dir("build\\windows\\x64\\runner\\Release") {
|
|
bat 'tar -cvf ..\\..\\..\\..\\..\\windows.tgz .'
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
always {
|
|
archiveArtifacts artifacts: "windows.tgz"
|
|
|
|
cleanWs()
|
|
}
|
|
}
|
|
}
|
|
|
|
stage("Build Linux") {
|
|
agent {
|
|
label 'linux'
|
|
}
|
|
|
|
steps {
|
|
script {
|
|
sh '''
|
|
#!/bin/bash
|
|
|
|
flutter pub get
|
|
mkdir out
|
|
flutter build linux
|
|
'''
|
|
|
|
dir("build/linux/x64/release/bundle") {
|
|
sh 'tar -cvf ../../../../../linux.tgz .'
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
always {
|
|
archiveArtifacts artifacts: "linux.tgz"
|
|
|
|
cleanWs()
|
|
}
|
|
}
|
|
}
|
|
|
|
stage("Build Android") {
|
|
agent {
|
|
label 'linux'
|
|
}
|
|
|
|
steps {
|
|
script {
|
|
sh '''
|
|
#!/bin/bash
|
|
|
|
flutter pub get
|
|
mkdir out
|
|
flutter build apk
|
|
flutter build appbundle
|
|
'''
|
|
|
|
dir("build/app/outputs/bundle/release") {
|
|
sh 'cp app-release.aab ../../../../../bugvault.aab'
|
|
}
|
|
|
|
dir("build/app/outputs/flutter-apk") {
|
|
sh 'cp app-release.apk ../../../../bugvault.apk'
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
always {
|
|
archiveArtifacts artifacts: "bugvault.aab"
|
|
archiveArtifacts artifacts: "bugvault.apk"
|
|
|
|
cleanWs()
|
|
}
|
|
}
|
|
}
|
|
|
|
stage("Build Web") {
|
|
agent {
|
|
label 'linux'
|
|
}
|
|
|
|
steps {
|
|
script {
|
|
sh '''
|
|
#!/bin/bash
|
|
|
|
flutter pub get
|
|
mkdir out
|
|
flutter build web
|
|
'''
|
|
|
|
dir("build/web") {
|
|
sh 'tar -cvf ../../web.tgz .'
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
always {
|
|
archiveArtifacts artifacts: "web.tgz"
|
|
|
|
cleanWs()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |