Freeze release workflow (#242)
* Freeze release workflow - Do not pull anything from master - Do not push release commit to master - Only push created version tag * Refine scripts to start new version 1. Cherry-pick hotfixes from released version 2. Bump version to new version Normally, 1 is only made of the release commit updating CHANGELOG with the release date. However, if a release branch was needed to apply hotfixes to the latest release, cherry picking will account for the whole release branch (i.e. multiple commits). * Ignore more paths for unit testing
This commit is contained in:
parent
e1a3e7992f
commit
7ef32882f1
|
@ -169,14 +169,10 @@ jobs:
|
||||||
git_commit_gpgsign: true
|
git_commit_gpgsign: true
|
||||||
git_tag_gpgsign: true
|
git_tag_gpgsign: true
|
||||||
git_push_gpgsign: false
|
git_push_gpgsign: false
|
||||||
- name: Pull metadata updates
|
|
||||||
run: |
|
|
||||||
git pull --no-tags origin $GITHUB_REF_NAME
|
|
||||||
git submodule update --recursive
|
|
||||||
- name: Tag release
|
- name: Tag release
|
||||||
run: |
|
run: |
|
||||||
scripts/ci/commit-release.sh $TAG_NAME
|
scripts/ci/commit-release.sh $TAG_NAME
|
||||||
git push && git push --tags
|
git push --tags
|
||||||
- name: Assemble notes
|
- name: Assemble notes
|
||||||
run: |
|
run: |
|
||||||
scripts/ci/release-notes.sh $TAG_NAME >$RELEASE_NOTES
|
scripts/ci/release-notes.sh $TAG_NAME >$RELEASE_NOTES
|
||||||
|
|
|
@ -6,6 +6,8 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '.beta-*'
|
- '.beta-*'
|
||||||
- '**/*.md'
|
- '**/*.md'
|
||||||
|
- '**/*.sh'
|
||||||
|
- '**/*.yml'
|
||||||
- 'Passepartout/App/fastlane/**'
|
- 'Passepartout/App/fastlane/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
VERSION_PREV=$1
|
||||||
|
if [[ -z $VERSION_PREV ]]; then
|
||||||
|
echo "Released version number required"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE_BASE=`git merge-base master "v$VERSION_PREV" 2>>/dev/null`
|
||||||
|
if [[ $? != 0 ]]; then
|
||||||
|
echo "Version does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
COMMITS_COUNT=`git rev-list --count $RELEASE_BASE..v$VERSION_PREV`
|
||||||
|
if [[ $COMMITS_COUNT == 0 ]]; then
|
||||||
|
echo "Version is already merged"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git checkout -b "merge/v$VERSION_PREV" master; then
|
||||||
|
echo "Could not create merge branch"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if ! git cherry-pick $RELEASE_BASE.."v$VERSION_PREV"; then
|
||||||
|
echo "Automatic cherry-picking has failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
|
@ -1,15 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
VERSION=$1
|
VERSION_NEXT=$2
|
||||||
|
if [[ -z $VERSION_NEXT ]]; then
|
||||||
if [[ -z $VERSION ]]; then
|
echo "New version number required"
|
||||||
echo "Version number required"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CHANGELOG_GLOB="CHANGELOG.md"
|
CHANGELOG_GLOB="CHANGELOG.md"
|
||||||
|
ci/set-version.sh $VERSION_NEXT
|
||||||
ci/set-version.sh $VERSION
|
|
||||||
sed -i '' -E "s/(^and this project adheres.*$)/\1\n\n## Unreleased/" $CHANGELOG_GLOB
|
sed -i '' -E "s/(^and this project adheres.*$)/\1\n\n## Unreleased/" $CHANGELOG_GLOB
|
||||||
|
|
||||||
git add *.plist $CHANGELOG_GLOB
|
git add *.plist $CHANGELOG_GLOB
|
||||||
git commit -m "Bump version"
|
git commit -m "Bump version"
|
Loading…
Reference in New Issue