passepartout-apple/scripts/commit-beta.sh

56 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash
CURRENT_BRANCH=`git branch --show-current`
if [[ $CURRENT_BRANCH != "master" ]]; then
echo "Not on master branch"
exit 1
fi
# pull latest API
2023-07-30 15:46:13 +00:00
API_PATH="PassepartoutLibrary/Sources/PassepartoutProvidersImpl/API"
if ! git -C $API_PATH pull origin master; then
echo "Could not pull API"
exit 1
fi
git add $API_PATH
# update bundle
bundle update
git add Gemfile.lock
# set build number
BASE_BUILD_FILE=".beta-base"
BUILD_FILE=".beta-build"
BUILD=$((`cat $BASE_BUILD_FILE` + `git rev-list HEAD --count` + 1))
ci/set-build.sh $BUILD
echo $BUILD >$BUILD_FILE
# set release notes
if [[ $1 != "keep-metadata" ]]; then
2023-12-31 00:24:00 +00:00
ci/update-release-notes.sh ios &&
ci/update-release-notes.sh mac &&
ci/update-release-notes.sh tvos
fi
2023-12-31 00:24:00 +00:00
ci/copy-release-notes.sh ios &&
ci/copy-release-notes.sh mac &&
ci/copy-release-notes.sh tvos
# add build number
git add $BASE_BUILD_FILE $BUILD_FILE
git add Passepartout.xcodeproj
git add *.plist
2023-07-05 16:07:47 +00:00
# set release date
VERSION=`ci/version-number.sh ios`
DATE=`date "+%Y-%m-%d"`
CHANGELOG_GLOB="CHANGELOG.md"
# either set new or replace existing
2023-09-09 23:07:53 +00:00
sed -i '' -E "s/^.*$VERSION.*$/## $VERSION ($DATE)/" $CHANGELOG_GLOB
sed -i '' -E "s/^.*Unreleased.*$/## $VERSION ($DATE)/" $CHANGELOG_GLOB
2023-07-05 16:07:47 +00:00
# add release notes
git add CHANGELOG.md
git add Passepartout/App/fastlane/*/metadata/*/release_notes.txt
2023-07-05 16:07:47 +00:00
git commit -m "Attempt release"