mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 20:44:32 -05:00
* Add an action to automatically generate release PRs * Add release notes * PR feedback: error handling
27 lines
800 B
Bash
Executable File
27 lines
800 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
version="${1#v}"
|
|
|
|
files_to_bump=(
|
|
packages/api/package.json
|
|
packages/desktop-client/package.json
|
|
packages/desktop-electron/package.json
|
|
)
|
|
|
|
for file in "${files_to_bump[@]}"; do
|
|
if [ -z "$version" ]; then
|
|
# version format: YY.MM.patch
|
|
# logic: if before the 25th, bump patch, else set minor/major to next month
|
|
version="$(jq -r .version "$file" | perl -e '($y,$m,$p)=split/\./,<>;$d=(localtime)[3];$d>25?($p=0,++$m,$m>12&&($m=1,++$y)):$p++;print"$y.$m.$p\n"')"
|
|
if [ -z "$version" ]; then
|
|
echo "Error: Failed to calculate new version" >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo "Bumping $file to version $version"
|
|
jq '.version = "'"$version"'"' "$file" > "$file.tmp"
|
|
mv "$file.tmp" "$file"
|
|
done
|