Some checks failed
ci/woodpecker/push/fx_oracle Pipeline is pending
ci/woodpecker/push/ledger Pipeline is pending
ci/woodpecker/push/nats Pipeline is pending
ci/woodpecker/push/notification Pipeline is pending
ci/woodpecker/push/payments_orchestrator Pipeline is pending
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline failed
ci/woodpecker/push/bump_version unknown status
ci/woodpecker/push/frontend Pipeline failed
35 lines
951 B
Bash
Executable File
35 lines
951 B
Bash
Executable File
# /bin/bash
|
|
|
|
echo "===================================="
|
|
echo "Incrementing build version..."
|
|
echo "===================================="
|
|
VERSION_FILE=./version
|
|
|
|
NEW_VERSION=$(cat $VERSION_FILE | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')
|
|
echo $NEW_VERSION > $VERSION_FILE
|
|
|
|
echo "New version is "$NEW_VERSION
|
|
|
|
echo "===================================="
|
|
echo "Bumping client version..."
|
|
echo "===================================="
|
|
FILE="./frontend/mweb/pubspec.yaml"
|
|
if sed --version >/dev/null 2>&1; then
|
|
# GNU sed
|
|
sed -i "s/^version: .*/version: ${NEW_VERSION}+1/" "$FILE"
|
|
else
|
|
# BSD/macOS sed
|
|
sed -i '' -e "s/^version: .*/version: ${NEW_VERSION}+1/" "$FILE"
|
|
fi
|
|
|
|
set -euo pipefail
|
|
|
|
# update version file(s) here
|
|
# e.g.: ./ci/scripts/common/update_version_file.sh
|
|
|
|
if ! git diff --quiet; then
|
|
git add .
|
|
git commit -m "chore: bump build version [skip ci]"
|
|
git push origin HEAD:main
|
|
fi
|