Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
bd0f990d
Unverified
Commit
bd0f990d
authored
Aug 02, 2019
by
Scott Cyphers
Committed by
GitHub
Aug 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3337 from NervanaSystems/silee2/release_script
NGCORE-526
parents
f23a86aa
97af44b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
2 deletions
+78
-2
CMakeLists.txt
CMakeLists.txt
+2
-1
git_tags.cmake
cmake/Modules/git_tags.cmake
+11
-1
create_release.py
maint/create_release.py
+65
-0
No files found.
CMakeLists.txt
View file @
bd0f990d
...
...
@@ -40,8 +40,9 @@ include(var_functions)
NGRAPH_GET_VERSION_LABEL
()
string
(
REGEX MATCH
"([0-9?]+)
\\
.([0-9?]+)
\\
.([0-9?]+)(-
rc
\\
.[0-9?]+)?"
NGRAPH_VERSION_SHORT
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REGEX MATCH
"([0-9?]+)
\\
.([0-9?]+)
\\
.([0-9?]+)(-
(rc|dev)
\\
.[0-9?]+)?"
NGRAPH_VERSION_SHORT
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REGEX REPLACE
"-rc."
"rc"
NGRAPH_WHEEL_VERSION
"
${
NGRAPH_VERSION_SHORT
}
"
)
string
(
REGEX REPLACE
"-dev."
"dev"
NGRAPH_WHEEL_VERSION
"
${
NGRAPH_WHEEL_VERSION
}
"
)
string
(
REGEX MATCH
"([0-9?]+)
\\
.([0-9?]+)"
NGRAPH_API_VERSION
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REGEX MATCH
"[^v](.*)"
NGRAPH_VERSION
"
${
NGRAPH_VERSION_LABEL
}
"
)
string
(
REPLACE
"."
";"
NGRAPH_VERSION_PARTS
"
${
NGRAPH_VERSION_SHORT
}
"
)
...
...
cmake/Modules/git_tags.cmake
View file @
bd0f990d
...
...
@@ -23,6 +23,9 @@ function(NGRAPH_GET_CURRENT_HASH)
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
ERROR_QUIET
)
if
(
NOT HASH
)
return
()
endif
()
string
(
STRIP
${
HASH
}
HASH
)
set
(
NGRAPH_CURRENT_HASH
${
HASH
}
PARENT_SCOPE
)
endfunction
()
...
...
@@ -75,7 +78,14 @@ function(NGRAPH_GET_VERSION_LABEL)
if
(
NOT
${
NGRAPH_MOST_RECENT_RELEASE_TAG
}
STREQUAL
""
)
set
(
NGRAPH_VERSION_LABEL
"
${
NGRAPH_MOST_RECENT_RELEASE_TAG
}
+
${
HASH
}
"
PARENT_SCOPE
)
else
()
set
(
NGRAPH_VERSION_LABEL
"?.?.?+
${
HASH
}
"
PARENT_SCOPE
)
if
(
HASH
)
set
(
NGRAPH_VERSION_LABEL
"?.?.?+
${
HASH
}
"
PARENT_SCOPE
)
else
()
# Not in a git repo
file
(
READ
${
CMAKE_SOURCE_DIR
}
/TAG NGRAPH_TAG
)
string
(
STRIP
${
NGRAPH_TAG
}
NGRAPH_TAG
)
set
(
NGRAPH_VERSION_LABEL
"
${
NGRAPH_TAG
}
"
PARENT_SCOPE
)
endif
()
endif
()
endif
()
endfunction
()
maint/create_release.py
0 → 100644
View file @
bd0f990d
# ******************************************************************************
# Copyright 2017-2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
import
sys
import
os
import
subprocess
import
tempfile
import
tarfile
import
zipfile
assert
sys
.
version_info
>=
(
3
,
4
)
swd
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
swd
=
swd
+
'/..'
swd
=
os
.
path
.
realpath
(
swd
)
get_tag
=
subprocess
.
Popen
([
'git'
,
'describe'
,
'--tags'
,
'--abbrev=0'
,
'--match'
,
'v*.*.*'
],
cwd
=
swd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
tag
=
[
line
.
strip
()
.
decode
()
for
line
in
get_tag
.
stdout
.
readlines
()]
retval
=
get_tag
.
wait
()
get_files
=
subprocess
.
Popen
([
'git'
,
'ls-tree'
,
'-r'
,
'HEAD'
,
'--name-only'
],
cwd
=
swd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
files
=
[
line
.
strip
()
.
decode
()
for
line
in
get_files
.
stdout
.
readlines
()]
retval
=
get_files
.
wait
()
# create tarball for Linux and macOS
with
tarfile
.
open
(
swd
+
'/ngraph-'
+
tag
[
0
]
+
'.tar.gz'
,
'w:gz'
)
as
tar
:
for
f
in
files
:
file_path
=
swd
+
'/'
+
f
tar
.
add
(
file_path
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/'
+
f
)
with
tempfile
.
NamedTemporaryFile
()
as
tag_file
:
tag_line
=
tag
[
0
]
+
'
\n
'
tag_file
.
write
(
tag_line
.
encode
())
tag_file
.
flush
()
tar
.
add
(
tag_file
.
name
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/TAG'
)
# create zipfile for Windows
TO
=
b
'
\r\n
'
FROM
=
b
'
\n
'
with
zipfile
.
ZipFile
(
swd
+
'/ngraph-'
+
tag
[
0
]
+
'.zip'
,
'w'
,
zipfile
.
ZIP_DEFLATED
)
as
zipf
:
for
f
in
files
:
with
open
(
file_path
,
'rb'
)
as
unix_file
:
win_content
=
unix_file
.
read
()
.
replace
(
FROM
,
TO
)
with
tempfile
.
NamedTemporaryFile
()
as
win_file
:
win_file
.
write
(
win_content
)
zipf
.
write
(
win_file
.
name
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/'
+
f
)
with
tempfile
.
NamedTemporaryFile
()
as
tag_file
:
tag_line
=
tag
[
0
]
+
'
\r\n
'
tag_file
.
write
(
tag_line
.
encode
())
tag_file
.
flush
()
zipf
.
write
(
tag_file
.
name
,
arcname
=
'ngraph-'
+
tag
[
0
][
1
:]
+
'/TAG'
)
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