passepartout-apple/scripts/ci/commit-release.sh
Davide De Rosa 2a5c231d3d
Polish release workflow (#207)
* Do run tests in beta

- Test and build app in same lane
- Run tests with swift directly
- Set timeout on build only
- Set GYM_OUTPUT_DIRECTORY inline
- Fix bad build number, broken in db075eb
- Ignore updates to CHANGELOG for testing
- Drop unnecessary exports
- Drop unnecessary test env
- Drop unused PLATFORM .env.* variable

* Work around gym issues in CI

- Set custom build paths for proper clean-up
- Disable xcpretty (seems to hang job)

* Add descriptive names to workflow

- Rename beta to release
- Add job names

* Optimize release workflow

- Use a matrix for multiplatform build
- Only preinstall platform-specific certificates
- Output app version/build early for job reuse
- Do not depend app review on public beta release
- Pull latest commits before pushing/tagging

In release, ci/* scripts require Ruby. Make version an argument
of the commit-release.sh script to fix dependency.

* Import secret to notify external testers or not

* [ci skip] Add CHANGELOG preface in local scripts

* [ci skip] Update links to release via CI
2021-12-03 15:31:19 +01:00

30 lines
681 B
Bash
Executable File

#!/bin/bash
CURRENT_BRANCH=`git branch --show-current`
if [[ $CURRENT_BRANCH != "master" ]]; then
echo "Not on master branch"
exit 1
fi
VERSION=$1
if [[ -z $VERSION ]]; then
echo "Must provide version"
exit 1
fi
DATE=`date "+%Y-%m-%d"`
CHANGELOG_GLOB="Passepartout/App/*/CHANGELOG.md"
COMMIT_MESSAGE="[ci skip] Set release date"
TAG_MESSAGE="Release"
sed -i'' -E "s/^.*Unreleased.*$/## $VERSION ($DATE)/" $CHANGELOG_GLOB
if ! git commit -am "$COMMIT_MESSAGE"; then
echo "Failed to commit release"
git reset --hard
exit 1
fi
if ! git tag -a "v$VERSION" -m "$TAG_MESSAGE"; then
echo "Failed to tag release"
git reset --hard HEAD^
exit 1
fi