Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
d1e94573
Unverified
Commit
d1e94573
authored
Jan 08, 2021
by
liuzhe-lz
Committed by
GitHub
Jan 08, 2021
Browse files
Update release pipeline to support rc (#3278)
parent
6e5584a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
pipelines/release.yml
pipelines/release.yml
+16
-12
No files found.
pipelines/release.yml
View file @
d1e94573
...
...
@@ -16,9 +16,11 @@ jobs:
displayName
:
Configure Python version
-
script
:
|
echo $(build_type)
echo $(NNI_RELEASE)
export BRANCH_TAG=`git describe --tags --abbrev=0`
echo $BRANCH_TAG
if [[ $BRANCH_TAG = v$(NNI_RELEASE) && $(NNI_RELEASE) =~ ^v[0-9](.[0-9])+$ ]]; then
if [[ $BRANCH_TAG =
=
v$(NNI_RELEASE) && $(NNI_RELEASE) =~ ^v[0-9](.[0-9])+$ ]]; then
echo 'Build version match branch tag'
else
echo 'Build version does not match branch tag'
...
...
@@ -28,15 +30,16 @@ jobs:
displayName
:
Validate release version number and branch tag
-
script
:
|
echo $(build_type)
echo $(NNI_RELEASE)
if [[ $(NNI_RELEASE) =~ ^[0-9](.[0-9])+
a
[0-9]$ ]]; then
if [[ $(NNI_RELEASE) =~ ^[0-9](.[0-9])+
(a|b|rc)
[0-9]$ ]]; then
echo 'Valid prerelease version $(NNI_RELEASE)'
echo `git describe --tags --abbrev=0`
else
echo 'Invalid build version $(NNI_RELEASE)'
exit 1
fi
condition
:
ne( variables['build_type'], '
re
release' )
condition
:
ne( variables['build_type'], 'release' )
displayName
:
Validate prerelease version number
-
job
:
linux
...
...
@@ -57,17 +60,17 @@ jobs:
displayName
:
Build wheel
-
script
:
|
if [ $(build_type) = 'release' ]; then
echo 'uploading
release package
to pypi...'
if [
[
$(build_type) =
=
'release'
|| $(build_type) == 'rc' ]
]; then
echo 'uploading to pypi...'
python -m twine upload -u nni -p $(pypi_password) dist/*
else
echo 'uploading
prerelease package
to testpypi...'
echo 'uploading to testpypi...'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
fi
displayName
:
Upload wheel
-
script
:
|
if [ $(build_type) = 'release' ]; then
if [
[
$(build_type) =
=
'release'
|| $(build_type) == 'rc' ]
]; then
docker login -u msranni -p $(docker_hub_password)
export IMAGE_NAME=msranni/nni
else
...
...
@@ -78,8 +81,10 @@ jobs:
echo "## Building ${IMAGE_NAME}:$(NNI_RELEASE) ##"
docker build --build-arg NNI_RELEASE=$(NNI_RELEASE) -t ${IMAGE_NAME} .
docker tag ${IMAGE_NAME} ${IMAGE_NAME}:$(NNI_RELEASE)
docker push ${IMAGE_NAME}
docker push ${IMAGE_NAME}:$(NNI_RELEASE)
if [[ $(build_type) != 'rc' ]]; then
docker push ${IMAGE_NAME}
fi
displayName
:
Build and upload docker image
-
job
:
macos
...
...
@@ -100,7 +105,7 @@ jobs:
displayName
:
Build wheel
-
script
:
|
if [ $(build_type) = 'release' ]; then
if [
[
$(build_type) =
=
'release'
|| $(build_type) == 'rc' ]
]; then
echo '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/*
else
...
...
@@ -127,11 +132,10 @@ jobs:
displayName
:
Build wheel
-
powershell
:
|
if($env:BUILD_TYPE -eq 'release'
)
{
if
($env:BUILD_TYPE -eq 'release'
-Or $env:BUILD_TYPE -eq 'rc')
{
Write-Host '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/*
}
else{
} else {
Write-Host '## uploading to testpypi ##'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment