@@ -35,49 +35,78 @@ pipeline {
3535 pip install requests
3636 """
3737 }
38- }
38+ }
3939 stage(' Beta Release' ) {
40- // when {
41- // branch '*-beta'
42- // }
4340 steps {
4441 script {
45- def version = readFile(' version-beta.conf' ). trim()
46- env. versionTag = version
47- echo " Using version from version-beta.conf: ${ env.versionTag} "
48- }
49- sh """
50- sed -i 's/version = "[0-9]\\ +\\ .[0-9]\\ +\\ .[0-9]\\ +"/version = "${ env.versionTag} "/g' pyproject.toml
51- """
42+ sh '''
43+ # Install required Python packages
44+ pip install toml build
5245
53- sh '''
54- pip install toml
55-
56- cat <<EOF > update_name.py
46+ # Write Python code to a file (no indentation!)
47+ cat > update_name.py <<EOF
5748 import toml
5849 data = toml.load('pyproject.toml')
5950 data['project']['name'] = 'superclient-beta'
6051 with open('pyproject.toml', 'w') as f:
6152 toml.dump(data, f)
6253 EOF
6354
64- python3 update_name.py
65- '''
66-
67- sh ' pip install build'
68- sh ' python -m build'
69- sh ' ls dist/'
70- // withCredentials([usernamePassword(credentialsId: 'superstream-pypi', usernameVariable: 'USR', passwordVariable: 'PSW')]) {
71- // sh """
72- // python3 patch/patch.py --src "dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl" --output "dist/" --prefix "superstream_confluent_kafka_beta-${env.versionTag}"
73- // """
74- // sh"""
75- // rm dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl
76- // /tmp/.local/bin/pdm publish --no-build --username $USR --password $PSW
77- // """
78- // }
55+ # Run the Python script to update pyproject.toml
56+ python3 update_name.py
57+
58+ # Build the package using PEP 517
59+ python -m build
60+
61+ # Show artifacts
62+ ls -lh dist/
63+ '''
64+ }
7965 }
8066 }
67+
68+ // stage('Beta Release') {
69+ // // when {
70+ // // branch '*-beta'
71+ // // }
72+ // steps {
73+ // script {
74+ // def version = readFile('version-beta.conf').trim()
75+ // env.versionTag = version
76+ // echo "Using version from version-beta.conf: ${env.versionTag}"
77+ // }
78+ // sh """
79+ // sed -i 's/version = "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"/version = "${env.versionTag}"/g' pyproject.toml
80+ // """
81+
82+ // sh '''
83+ // pip install toml
84+
85+ // cat <<EOF > update_name.py
86+ // import toml
87+ // data = toml.load('pyproject.toml')
88+ // data['project']['name'] = 'superclient-beta'
89+ // with open('pyproject.toml', 'w') as f:
90+ // toml.dump(data, f)
91+ // EOF
92+
93+ // python3 update_name.py
94+ // '''
95+
96+ // sh 'pip install build'
97+ // sh 'python -m build'
98+ // sh 'ls dist/'
99+ // // withCredentials([usernamePassword(credentialsId: 'superstream-pypi', usernameVariable: 'USR', passwordVariable: 'PSW')]) {
100+ // // sh """
101+ // // python3 patch/patch.py --src "dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl" --output "dist/" --prefix "superstream_confluent_kafka_beta-${env.versionTag}"
102+ // // """
103+ // // sh"""
104+ // // rm dist/superstream_confluent_kafka_beta-${env.versionTag}-cp311-cp311-linux_x86_64.whl
105+ // // /tmp/.local/bin/pdm publish --no-build --username $USR --password $PSW
106+ // // """
107+ // // }
108+ // }
109+ // }
81110 // stage('Prod Release') {
82111 // when {
83112 // branch '2.4.0'
0 commit comments