File: update.sh

package info (click to toggle)
python-pbs-installer 2025.12.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 584 kB
  • sloc: python: 6,137; sh: 24; makefile: 2
file content (33 lines) | stat: -rwxr-xr-x 735 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
set -exo pipefail

FIND_SCRIPT=$(dirname "$(readlink -f "$0")")/find_versions.py
LIBRARY_PATH=src/pbs_installer

python3 "$FIND_SCRIPT" "$LIBRARY_PATH/_versions.py"

pipx run ruff format $LIBRARY_PATH

if [[ ! $(git status --porcelain) ]]; then
    echo "No changes to commit"
    exit 1
fi
if [ -n "$TARGET_VERSION" ]; then
    NEW_VERSION=$TARGET_VERSION
else
    # get the current date in YYYY.M.d format
    NEW_VERSION=$(date +%Y.%-m.%-d)
fi

echo "Commit new files"
set -x
git add "$LIBRARY_PATH/"
git commit -m "Bump version to $NEW_VERSION"
git tag -a "$NEW_VERSION" -m "Bump version to $NEW_VERSION"
set +x

if [ -n "$GITHUB_OUTPUT" ]; then
    echo "VERSION=$NEW_VERSION" >> "$GITHUB_OUTPUT"
fi

echo "All done!"