Debian Codegraph @

utils/update_release.sh

raw
1 #!/bin/bash
2 #
3 # Script that makes changes in preparation of a new release, such as updating
4 # the version and documentation.
5
6 EXIT_FAILURE=1
7 EXIT_SUCCESS=0
8
9 VERSION=$(date -u +"%Y%m%d")
10
11 # Update the Python module version.
12 sed "s/__version__ = '[0-9]*'/__version__ = '${VERSION}'/" -i acstore/__init__.py
13
14 # Update the version in the pyproject configuration.
15 sed "s/version = \"[0-9]*\"/version = \"${VERSION}\"/" -i pyproject.toml
16
17 # Ensure shebangs of Python scripts are consistent.
18 find . -name \*.py -exec sed '1s?^#!.*$?#!/usr/bin/env python3?' -i {} \;
19
20 # Update the version in the dpkg configuration files.
21 DPKG_DATE=$(date -R)
22
23 cat > config/dpkg/changelog << EOT
24 acstore (${VERSION}-1) unstable; urgency=low
25
26 * Auto-generated
27
28 -- Log2Timeline maintainers <[email protected]> ${DPKG_DATE}
29 EOT
30
31 # Regenerate the API documentation.
32 tox -edocs
33
34 exit ${EXIT_SUCCESS}
35