change Archive Build Artifacts

This commit is contained in:
William Bell
2025-12-01 02:22:44 +00:00
parent 7d272a2f4d
commit 5741fb4185

35
Jenkinsfile vendored
View File

@@ -79,20 +79,33 @@ pipeline {
} }
} }
stage('Archive Build Artifacts') { stage('Archive Build Artifacts') {
steps { steps {
sh ''' script {
# Copy LICENSE.txt into build/bin // Determine platform
cp LICENSE.txt build/bin/ def os = sh(returnStdout: true, script: 'uname -s').trim().toLowerCase()
def arch = sh(returnStdout: true, script: 'uname -m').trim().toLowerCase()
# Create tarball with the contents of build/bin at the root // Determine version (tag or "dev")
tar -czf chloride-linux-x86_64.tar.gz -C build/bin . def version = env.TAG_NAME ?: "dev"
'''
// Archive the tarball // Construct file name
archiveArtifacts artifacts: 'chloride-linux-x86_64.tar.gz', allowEmptyArchive: false env.OUTPUT_FILE = "chloride-${version}-${os}-${arch}.tar.gz"
}
echo "Packaging as: ${env.OUTPUT_FILE}"
} }
sh '''
# Ensure LICENSE.txt is in the output directory
cp LICENSE.txt build/bin/
# Create tarball with auto-generated name
tar -czf "$OUTPUT_FILE" -C build/bin .
'''
archiveArtifacts artifacts: "${env.OUTPUT_FILE}", allowEmptyArchive: false
} }
}
post { post {
always { always {