diff --git a/.gitignore b/.gitignore index 4d77141..3ee32c0 100644 --- a/.gitignore +++ b/.gitignore @@ -132,7 +132,6 @@ android/app/google-services.json google_maps_api.xml # Web related -lib/generated_plugin_registrant.dart # Obfuscation related app.*.map.json @@ -862,4 +861,4 @@ Temporary Items # Archives - https://github.com/github/gitignore/blob/main/Global/Archives.gitignore # Backup - https://github.com/github/gitignore/blob/main/Global/Backup.gitignore -# JEnv - https://github.com/github/gitignore/blob/main/Global/JEnv.gitignore \ No newline at end of file +# JEnv - https://github.com/github/gitignore/blob/main/Global/JEnv.gitignore diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..d6229ac --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,134 @@ +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() + } + } + } + } +} \ No newline at end of file