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
"...composable_kernel.git" did not exist on "9f71ff48e28709c8132735d80af57ec90626d4b5"
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:
...
@@ -16,9 +16,11 @@ jobs:
displayName
:
Configure Python version
displayName
:
Configure Python version
-
script
:
|
-
script
:
|
echo $(build_type)
echo $(NNI_RELEASE)
export BRANCH_TAG=`git describe --tags --abbrev=0`
export BRANCH_TAG=`git describe --tags --abbrev=0`
echo $BRANCH_TAG
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'
echo 'Build version match branch tag'
else
else
echo 'Build version does not match branch tag'
echo 'Build version does not match branch tag'
...
@@ -28,15 +30,16 @@ jobs:
...
@@ -28,15 +30,16 @@ jobs:
displayName
:
Validate release version number and branch tag
displayName
:
Validate release version number and branch tag
-
script
:
|
-
script
:
|
echo $(build_type)
echo $(NNI_RELEASE)
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 'Valid prerelease version $(NNI_RELEASE)'
echo `git describe --tags --abbrev=0`
echo `git describe --tags --abbrev=0`
else
else
echo 'Invalid build version $(NNI_RELEASE)'
echo 'Invalid build version $(NNI_RELEASE)'
exit 1
exit 1
fi
fi
condition
:
ne( variables['build_type'], '
re
release' )
condition
:
ne( variables['build_type'], 'release' )
displayName
:
Validate prerelease version number
displayName
:
Validate prerelease version number
-
job
:
linux
-
job
:
linux
...
@@ -57,17 +60,17 @@ jobs:
...
@@ -57,17 +60,17 @@ jobs:
displayName
:
Build wheel
displayName
:
Build wheel
-
script
:
|
-
script
:
|
if [ $(build_type) = 'release' ]; then
if [
[
$(build_type) =
=
'release'
|| $(build_type) == 'rc' ]
]; then
echo 'uploading
release package
to pypi...'
echo 'uploading to pypi...'
python -m twine upload -u nni -p $(pypi_password) dist/*
python -m twine upload -u nni -p $(pypi_password) dist/*
else
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/*
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
fi
fi
displayName
:
Upload wheel
displayName
:
Upload wheel
-
script
:
|
-
script
:
|
if [ $(build_type) = 'release' ]; then
if [
[
$(build_type) =
=
'release'
|| $(build_type) == 'rc' ]
]; then
docker login -u msranni -p $(docker_hub_password)
docker login -u msranni -p $(docker_hub_password)
export IMAGE_NAME=msranni/nni
export IMAGE_NAME=msranni/nni
else
else
...
@@ -78,8 +81,10 @@ jobs:
...
@@ -78,8 +81,10 @@ jobs:
echo "## Building ${IMAGE_NAME}:$(NNI_RELEASE) ##"
echo "## Building ${IMAGE_NAME}:$(NNI_RELEASE) ##"
docker build --build-arg NNI_RELEASE=$(NNI_RELEASE) -t ${IMAGE_NAME} .
docker build --build-arg NNI_RELEASE=$(NNI_RELEASE) -t ${IMAGE_NAME} .
docker tag ${IMAGE_NAME} ${IMAGE_NAME}:$(NNI_RELEASE)
docker tag ${IMAGE_NAME} ${IMAGE_NAME}:$(NNI_RELEASE)
docker push ${IMAGE_NAME}
docker push ${IMAGE_NAME}:$(NNI_RELEASE)
docker push ${IMAGE_NAME}:$(NNI_RELEASE)
if [[ $(build_type) != 'rc' ]]; then
docker push ${IMAGE_NAME}
fi
displayName
:
Build and upload docker image
displayName
:
Build and upload docker image
-
job
:
macos
-
job
:
macos
...
@@ -100,7 +105,7 @@ jobs:
...
@@ -100,7 +105,7 @@ jobs:
displayName
:
Build wheel
displayName
:
Build wheel
-
script
:
|
-
script
:
|
if [ $(build_type) = 'release' ]; then
if [
[
$(build_type) =
=
'release'
|| $(build_type) == 'rc' ]
]; then
echo '## uploading to pypi ##'
echo '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/*
python -m twine upload -u nni -p $(pypi_password) dist/*
else
else
...
@@ -127,11 +132,10 @@ jobs:
...
@@ -127,11 +132,10 @@ jobs:
displayName
:
Build wheel
displayName
:
Build wheel
-
powershell
:
|
-
powershell
:
|
if($env:BUILD_TYPE -eq 'release'
)
{
if
($env:BUILD_TYPE -eq 'release'
-Or $env:BUILD_TYPE -eq 'rc')
{
Write-Host '## uploading to pypi ##'
Write-Host '## uploading to pypi ##'
python -m twine upload -u nni -p $(pypi_password) dist/*
python -m twine upload -u nni -p $(pypi_password) dist/*
}
} else {
else{
Write-Host '## uploading to testpypi ##'
Write-Host '## uploading to testpypi ##'
python -m twine upload -u nni -p $(pypi_password) --repository-url https://test.pypi.org/legacy/ dist/*
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