Edit the jenkinsfile

This commit is contained in:
zontreck 2024-07-21 18:41:38 -07:00
parent ea444adfc4
commit 270d097102

43
Jenkinsfile vendored
View file

@ -2,54 +2,45 @@ pipeline {
agent any agent any
options { options {
buildDiscarder( buildDiscarder(logRotator(numToKeepStr: '5'))
logRotator(
numToKeepStr: '5'
)
)
} }
stages { stages {
stage ("Build on Linux") { stage("Build on Linux") {
agent { agent {
label 'linux' label 'linux'
} }
steps { steps {
script { script {
sh ''' // Ensure that all necessary directories exist before operations
#!/bin/bash sh 'flutter pub get'
sh 'chmod +x compile.sh'
sh './compile.sh'
flutter pub get // Move to the correct directories and archive artifacts
chmod +x compile.sh dir('build/linux/x64/release/bundle') {
./compile.sh archiveArtifacts artifacts: '*.tgz', fingerprint: true
}
cd build/linux/x64/release/bundle dir('build/app/outputs/flutter-apk') {
tar -cvf ../../../../../linux.tgz ./ archiveArtifacts artifacts: '*.apk', fingerprint: true
cd ../../../../app/outputs/flutter-apk }
cp app-release.apk ../../../../ archiveArtifacts artifacts: 'out/*nb*', fingerprint: true
'''
} }
} }
post { post {
always { always {
archiveArtifacts artifacts: '*.tgz', fingerprint: true
archiveArtifacts artifacts: '*.apk', fingerprint: true
archiveArtifacts artifacts: 'out/*nb*', fingerprint: true
deleteDir() deleteDir()
} }
} }
} }
stage ('Build on Windows') {
stage('Build on Windows') {
agent { agent {
label 'windows' label 'windows'
} }
steps { steps {
script { script {
bat ''' bat '''
@echo off
flutter build windows flutter build windows
dart compile exe -o out/snbt2nbt.exe bin/snbt2nbt.dart dart compile exe -o out/snbt2nbt.exe bin/snbt2nbt.dart
dart compile exe -o out/nbt2snbt.exe bin/nbt2snbt.dart dart compile exe -o out/nbt2snbt.exe bin/nbt2snbt.dart
@ -67,4 +58,4 @@ pipeline {
} }
} }
} }
} }