File: rtd-pre-sphinx-build.sh

package info (click to toggle)
python-globus-sdk 3.54.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,032 kB
  • sloc: python: 34,226; sh: 44; makefile: 31
file content (42 lines) | stat: -rwxr-xr-x 1,098 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
#!/bin/bash

VERSION=$(grep '^__version__' src/globus_sdk/version.py | cut -d '"' -f2)

case "$READTHEDOCS_VERSION_TYPE" in
    external)
        echo "detected PR build"
        VERSION="${VERSION}-pr-${READTHEDOCS_VERSION_NAME}"
        ;;
    branch)
        case "${READTHEDOCS_VERSION_NAME}" in
            latest)
                echo "detected 'latest' branch build"
                VERSION="${VERSION}-dev"
                ;;
            *)
                echo "detected non-'latest' branch build"
                echo "exiting(ok)..."
                exit 0
                ;;
        esac
        ;;
    tag | unknown)
        echo "not a PR or branch build"
        echo "exiting(ok)..."
        exit 0
        ;;
    *)
        echo "unrecognized build type"
        echo "exiting(fail)..."
        exit 1
        ;;
esac
echo "detection succeeded: VERSION=${VERSION}"

if [ -z "$(find changelog.d -name '*.rst')" ]; then
    echo "no changes visible in changelog.d/"
    echo "exiting without running 'scriv collect'"
    exit 0
fi

scriv collect --keep --version "$VERSION" -v DEBUG