Skip to content

Commit 89d2ccd

Browse files
change versioning
1 parent 0179f82 commit 89d2ccd

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

Jenkinsfile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ pipeline {
4444
branch 'master'
4545
}
4646
steps {
47-
script {
48-
def version = readFile('version-beta.conf').trim()
49-
env.versionTag = version
50-
echo "Using version from version-beta.conf: ${env.versionTag}"
51-
}
52-
sh """
53-
sed -i 's/version = "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"/version = "${env.versionTag}"/g' pyproject.toml
54-
"""
5547
sh '''
5648
sed -i -E 's/^(name *= *")superclient(")/\\1superclient-beta\\2/' pyproject.toml
5749
'''
@@ -71,14 +63,6 @@ pipeline {
7163
branch 'latest'
7264
}
7365
steps {
74-
script {
75-
def version = readFile('version.conf').trim()
76-
env.versionTag = version
77-
echo "Using version from version.conf: ${env.versionTag}"
78-
}
79-
sh """
80-
sed -i 's/version = "[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"/version = "${env.versionTag}"/g' pyproject.toml
81-
"""
8266
sh 'pip install --quiet build twine'
8367
sh 'python -m build'
8468
withCredentials([usernamePassword(credentialsId: 'superstream-pypi', usernameVariable: 'USR', passwordVariable: 'PSW')]) {
@@ -94,7 +78,17 @@ pipeline {
9478
when {
9579
branch 'latest'
9680
}
97-
steps {
81+
steps {
82+
script {
83+
def version = sh(
84+
script: '''
85+
python3 -c "import toml; print(toml.load('pyproject.toml')['project']['version'])"
86+
''',
87+
returnStdout: true
88+
).trim()
89+
90+
env.versionTag = version
91+
}
9892
sh """
9993
curl -L https://github.com/cli/cli/releases/download/v2.40.0/gh_2.40.0_linux_amd64.tar.gz -o gh.tar.gz
10094
tar -xvf gh.tar.gz

version-beta.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

version.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)