FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
climada_python/.github/scripts/make_release.py at main · amowat/climada_python · GitHub
amowat
/
climada_python
Public
forked from
CLIMADA-project/climada_python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
climada_python
/
.github
/
scripts
/
make_release.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (25 loc) · 872 Bytes
Breadcrumbs
climada_python
/
.github
/
scripts
/
make_release.py
Copy path
File metadata and controls
33 lines (25 loc) · 872 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
"""This script is part of the GitHub CI make-release pipeline
It reads the version number from climada*/_version.py and then uses the `gh` cli
to create the new release.
"""
import
glob
import
re
import
subprocess
def
get_version
()
->
str
:
"""Return the current version number, based on the _version.py file."""
[
version_file
]
=
glob
.
glob
(
"climada*/_version.py"
)
with
open
(
version_file
,
"r"
,
encoding
=
"UTF-8"
)
as
vfp
:
content
=
vfp
.
read
()
regex
=
r"^__version__\s*=\s*[\'\"](.*)[\'\"]\s*$"
mtch
=
re
.
match
(
regex
,
content
)
return
mtch
.
group
(
1
)
def
make_release
():
"""run `gh release create vX.Y.Z"""
version_number
=
get_version
()
subprocess
.
run
(
[
"gh"
,
"release"
,
"create"
,
"--generate-notes"
,
f"v
{
version_number
}
"
],
check
=
True
,
)
if
__name__
==
"__main__"
:
make_release
()
Back
|
FazBrowse Home
|
New Git URL