Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LHCbDIRAC
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Zhelezov
LHCbDIRAC
Commits
fc4c30d6
Commit
fc4c30d6
authored
3 years ago
by
Chris Burr
Browse files
Options
Downloads
Patches
Plain Diff
Upload releases to PyPI automatically
parent
03c160ed
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+19
-0
19 additions, 0 deletions
.gitlab-ci.yml
src/LHCbDIRAC/tests/Utilities/createReleaseFiles.py
+8
-2
8 additions, 2 deletions
src/LHCbDIRAC/tests/Utilities/createReleaseFiles.py
with
27 additions
and
2 deletions
.gitlab-ci.yml
+
19
−
0
View file @
fc4c30d6
...
...
@@ -531,6 +531,7 @@ make_tag:
-
mv releases.cfg src/LHCbDIRAC/releases.cfg
-
export SERIES=`cat series.txt`
-
export VERSION=`cat version.txt`
-
export VERSION_PY3=`cat versionPy3.txt`
# insert new release notes into the changelog
-
cat ../notes.txt CHANGELOG/$SERIES > newNotes.txt
-
mv newNotes.txt CHANGELOG/$SERIES
...
...
@@ -543,6 +544,7 @@ make_tag:
-
git commit -av -m "Update versions and changelog for release of ${VERSION}"
# tag current branch
-
git tag -a ${VERSION} -m ${VERSION}
-
git tag -a ${VERSION_PY3} -m ${VERSION_PY3}
# push commits and tag to main repo back
-
git push --tags origin ${CI_COMMIT_REF_NAME}
# If we just tagged master we need to update also the releases.cfg and CHANGELOG in devel
...
...
@@ -576,3 +578,20 @@ MR_SWEEP:
after_script
:
[]
script
:
-
python /sweep_MR.py -p ${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME} -b origin/${CI_COMMIT_REF_NAME} -t ${SWEEP_TOKEN} -s "${SWEEP_SINCE}" -u "${SWEEP_UNTIL}" --repository-root ${PWD}
deploy-to-pypi
:
stage
:
deploy_release
# TODO: Remove after this is proven to work
allow_failure
:
true
only
:
-
tags@lhcb-dirac/LHCbDIRAC
except
:
-
/^v[0-9]+r[0-9]+.+$/
image
:
registry.cern.ch/docker.io/-/python:3.9
before_script
:
-
pip install twine wheel setuptools-scm[toml]
script
:
-
python setup.py sdist
-
python setup.py bdist_wheel
-
if [ -z "$TWINE_PASSWORD" ] ; then echo "Set TWINE_PASSWORD in CI variables" ; exit 1 ; fi
-
twine upload -u __token__ dist/*
This diff is collapsed.
Click to expand it.
src/LHCbDIRAC/tests/Utilities/createReleaseFiles.py
+
8
−
2
View file @
fc4c30d6
...
...
@@ -59,6 +59,7 @@ NEXT_RELEASE = os.environ.get('NEXT_RELEASE')
# If the user did not specify a release increment the current version by 1
version
=
None
versionString
=
None
versionStringPy3
=
None
preRelease
=
None
if
not
NEXT_RELEASE
:
version
=
parseVersion
(
LATEST_RELEASE
)
...
...
@@ -66,14 +67,16 @@ if not NEXT_RELEASE:
# Increment patch version for 1
version
=
(
version
[
0
],
version
[
1
],
version
[
2
]
+
1
,
version
[
3
])
versionString
=
"
v%sr%sp%s
"
%
(
version
[
0
],
version
[
1
],
version
[
2
])
versionStringPy3
=
"
v%s.%s.%s
"
%
(
version
[
0
],
version
[
1
],
version
[
2
])
preRelease
=
False
print
(
"
A
c
tomatically increment current release %s to %s
"
%
(
LATEST_RELEASE
,
versionString
))
print
(
"
A
u
tomatically increment current release %s to %s
"
%
(
LATEST_RELEASE
,
versionString
))
else
:
# Increment pre version for 1
version
=
(
version
[
0
],
version
[
1
],
version
[
2
],
version
[
3
]
+
1
)
versionString
=
"
v%sr%s-pre%s
"
%
(
version
[
0
],
version
[
1
],
version
[
3
])
versionStringPy3
=
"
v%s.%s.0a%s
"
%
(
version
[
0
],
version
[
1
],
version
[
3
])
preRelease
=
True
print
(
"
A
c
tomatically increment current release %s to %s
"
%
(
LATEST_RELEASE
,
versionString
))
print
(
"
A
u
tomatically increment current release %s to %s
"
%
(
LATEST_RELEASE
,
versionString
))
else
:
# Use the version specified by NEXT_RELEASE
version
=
parseVersion
(
NEXT_RELEASE
)
...
...
@@ -103,6 +106,9 @@ linePrepend("../notes.txt", versionString)
# store into artifact the version and series for later usage in tagging process
with
open
(
'
version.txt
'
,
'
a
'
)
as
fver
:
fver
.
write
(
versionString
)
if
versionStringPy3
:
with
open
(
'
versionPy3.txt
'
,
'
a
'
)
as
fver
:
fver
.
write
(
versionStringPy3
)
with
open
(
'
series.txt
'
,
'
a
'
)
as
fser
:
fser
.
write
(
"
v%sr%s
"
%
(
version
[
0
],
version
[
1
]))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment