Edit the jenkinsfile
This commit is contained in:
parent
ea444adfc4
commit
270d097102
1 changed files with 17 additions and 26 deletions
41
Jenkinsfile
vendored
41
Jenkinsfile
vendored
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue