File: release

package info (click to toggle)
python-milc 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 788 kB
  • sloc: python: 1,868; sh: 55; makefile: 3
file content (73 lines) | stat: -rwxr-xr-x 1,320 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# Increment the verison number and release a new version of MILC.
#
# Required packages are in requirements-release.txt

set -e
set -x

echo "This script has been deprecated. Use the github action instead."
exit

case "$1" in
	major)
		BUMPVERSION_TYPE=major
	;;
	minor)
		BUMPVERSION_TYPE=minor
	;;
	*)
		BUMPVERSION_TYPE=${BUMPVERSION_TYPE:-patch}
	;;
esac


PYPI_USERNAME=${PYPI_USERNAME:=skully}
TWINE_USERNAME=$PYPI_USERNAME

export TWINE_USERNAME

# Install deps
python3 -m pip install --upgrade -r requirements-release.txt

# Make sure the tree is clean
if ! git status | grep 'working tree clean'; then
	echo '*** Working tree is not clean!'
	exit 1
fi
rm -f dist/*

# Make sure we're current with master
git pull --ff-only

# Generate the documentation
./generate_docs

if ! git status | grep 'working tree clean'; then
	docs_good=1
	for doc in docs/api*.md; do
		if ! grep -q "$(basename $doc)" docs/_summary.md; then
			echo "No _summary entry for ${doc}!"
			docs_good=0
		fi
	done

	if [ $docs_good -eq 0 ]; then
		exit 2
	fi

	git add .
	git commit -m"Generated API documentation."
fi

# Increment the version number
bumpversion $BUMPVERSION_TYPE

# Push our work up
git push origin master --tags

# Build our package
python3 setup.py sdist bdist_wheel

# Upload to pypi
twine upload dist/milc-*