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:
Davide De Rosa 2022-10-30 12:56:49 +01:00 committed by GitHub
parent e1a3e7992f
commit 7ef32882f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 12 deletions

View File

@ -169,14 +169,10 @@ jobs:
git_commit_gpgsign: true
git_tag_gpgsign: true
git_push_gpgsign: false
- name: Pull metadata updates
run: |
git pull --no-tags origin $GITHUB_REF_NAME
git submodule update --recursive
- name: Tag release
run: |
scripts/ci/commit-release.sh $TAG_NAME
git push && git push --tags
git push --tags
- name: Assemble notes
run: |
scripts/ci/release-notes.sh $TAG_NAME >$RELEASE_NOTES

View File

@ -6,6 +6,8 @@ on:
paths-ignore:
- '.beta-*'
- '**/*.md'
- '**/*.sh'
- '**/*.yml'
- 'Passepartout/App/fastlane/**'
jobs:

View File

@ -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

View File

@ -1,15 +1,12 @@
#!/bin/bash
VERSION=$1
if [[ -z $VERSION ]]; then
echo "Version number required"
VERSION_NEXT=$2
if [[ -z $VERSION_NEXT ]]; then
echo "New version number required"
exit 1
fi
CHANGELOG_GLOB="CHANGELOG.md"
ci/set-version.sh $VERSION
ci/set-version.sh $VERSION_NEXT
sed -i '' -E "s/(^and this project adheres.*$)/\1\n\n## Unreleased/" $CHANGELOG_GLOB
git add *.plist $CHANGELOG_GLOB
git commit -m "Bump version"