-
Notifications
You must be signed in to change notification settings - Fork 12
/
release.sos
executable file
·36 lines (28 loc) · 1017 Bytes
/
release.sos
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
34
35
36
#!/usr/bin/env sos-runner
#fileformat=SOS1.0
parameter: py = ""
[patch: shared = "version"]
parameter: version = str
sh: expand = True
perl -pi.bak -e "s/^__version__ = .*/__version__ = '{version}'/" src/version.py
perl -pi.bak -e "s/^Version: .*/Version: {version}/" dscrutils/DESCRIPTION
[readme: provides = 'README.rst']
depends: executable('pandoc')
sh: workdir = '.'
pandoc --from=markdown --to=rst --output=README.rst README.md
[pip]
depends: "README.rst", Py_Module('twine')
parameter: version = str
# check the version of the latest version
cur_ver = get_output(f"pip{py} show dsc | grep Version | cut -d' ' -f2").strip()
# do not upload if the version on pip is the current one
stop_if(cur_ver == version)
sh: workdir = '.', expand = True
python{py} setup.py sdist && \
twine upload dist/dsc-{version}.tar.gz && \
pip{py} install -U --upgrade-strategy only-if-needed .
[upgrade]
sh: expand = True
pip{py} install -U --upgrade-strategy only-if-needed dsc
[default]
sos_run('readme+patch+pip')