2023-04-08 10:36:11 +00:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
stages {
|
2023-04-21 16:23:56 +00:00
|
|
|
stage("clean") {
|
|
|
|
steps {
|
|
|
|
sh 'rm -rf ./dist/*'
|
|
|
|
}
|
|
|
|
}
|
2023-04-08 10:36:11 +00:00
|
|
|
stage("install") {
|
|
|
|
steps {
|
2023-04-21 16:23:56 +00:00
|
|
|
sh 'mamba env update --file environment.yml'
|
|
|
|
sh 'echo "mamba activate renamebycsv" >> ~/.bashrc'
|
2023-04-08 10:36:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("build") {
|
|
|
|
steps {
|
|
|
|
sh "python -m build"
|
|
|
|
}
|
|
|
|
}
|
2023-04-21 16:23:56 +00:00
|
|
|
stage("test") {
|
|
|
|
steps {
|
|
|
|
sh "pip install dist/*.whl"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("archive") {
|
|
|
|
steps {
|
|
|
|
archiveArtifacts artifacts: 'dist/*.tar.gz, dist/*.whl'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage("publish package") {
|
2023-04-08 18:14:45 +00:00
|
|
|
when {
|
2023-04-21 16:23:56 +00:00
|
|
|
branch '**/main'
|
2023-04-08 18:14:45 +00:00
|
|
|
}
|
2023-04-08 10:36:11 +00:00
|
|
|
steps {
|
|
|
|
withCredentials([usernamePassword(credentialsId: 'rs-git-package-registry-ydeng', passwordVariable: 'PASS', usernameVariable: 'USER')]) {
|
2023-04-08 17:51:38 +00:00
|
|
|
sh "python -m twine upload --repository-url https://git.reslate.systems/api/packages/${USER}/pypi -u ${USER} -p ${PASS} --non-interactive --disable-progress-bar --verbose dist/*"
|
2023-04-08 10:45:31 +00:00
|
|
|
}
|
2023-04-08 10:36:11 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|