2022-10-17 06:35:36 +00:00
|
|
|
#!/bin/bash
|
2021-09-29 08:53:44 +00:00
|
|
|
CURRENT_BRANCH=`git branch --show-current`
|
|
|
|
if [[ $CURRENT_BRANCH != "master" ]]; then
|
|
|
|
echo "Not on master branch"
|
2021-11-30 10:27:05 +00:00
|
|
|
exit 1
|
2021-09-29 08:53:44 +00:00
|
|
|
fi
|
|
|
|
|
2022-09-25 09:10:46 +00:00
|
|
|
# pull latest API
|
2023-07-30 15:46:13 +00:00
|
|
|
API_PATH="PassepartoutLibrary/Sources/PassepartoutProvidersImpl/API"
|
2022-09-25 09:10:46 +00:00
|
|
|
if ! git -C $API_PATH pull origin master; then
|
|
|
|
echo "Could not pull API"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
git add $API_PATH
|
|
|
|
|
2023-03-19 13:42:21 +00:00
|
|
|
# update bundle
|
|
|
|
bundle update
|
|
|
|
git add Gemfile.lock
|
|
|
|
|
2021-11-28 21:46:35 +00:00
|
|
|
# set build number
|
2022-09-25 09:10:46 +00:00
|
|
|
BASE_BUILD_FILE=".beta-base"
|
2021-12-03 14:31:19 +00:00
|
|
|
BUILD_FILE=".beta-build"
|
2022-09-25 09:10:46 +00:00
|
|
|
BUILD=$((`cat $BASE_BUILD_FILE` + `git rev-list HEAD --count` + 1))
|
2021-11-28 21:46:35 +00:00
|
|
|
ci/set-build.sh $BUILD
|
2021-12-03 14:31:19 +00:00
|
|
|
echo $BUILD >$BUILD_FILE
|
2021-11-28 21:46:35 +00:00
|
|
|
|
|
|
|
# set release notes
|
2023-04-05 05:54:26 +00:00
|
|
|
if [[ $1 != "keep-metadata" ]]; then
|
|
|
|
ci/update-release-notes.sh ios && ci/update-release-notes.sh mac
|
|
|
|
fi
|
|
|
|
ci/copy-release-notes.sh ios && ci/copy-release-notes.sh mac
|
2021-10-04 17:21:14 +00:00
|
|
|
|
2021-11-28 21:46:35 +00:00
|
|
|
# add build number
|
2022-09-25 09:10:46 +00:00
|
|
|
git add $BASE_BUILD_FILE $BUILD_FILE
|
2021-11-28 21:46:35 +00:00
|
|
|
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
|
|
|
|
2021-11-28 21:46:35 +00:00
|
|
|
# add release notes
|
2022-04-19 14:17:13 +00:00
|
|
|
git add CHANGELOG.md
|
2023-04-05 05:54:26 +00:00
|
|
|
git add Passepartout/App/fastlane/*/metadata/*/release_notes.txt
|
2021-09-29 08:53:44 +00:00
|
|
|
|
2023-07-05 16:07:47 +00:00
|
|
|
git commit -m "Attempt release"
|