Skip to content

Commit 9fd8454

Browse files
committed
Add build step and creating release branch to setup_sqlcipher.sh
1 parent f2eb112 commit 9fd8454

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

.github/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ of SQLCipher and embed it in GRDB.swift:
3939

4040
The script will also:
4141
* present the summary of updated versions and ask you to pick the new version number for DuckDuckGo GRDB fork,
42+
* test the build,
4243
* create a new release branch and commit changes.
4344

4445
For versioning, follow [Semantic Versioning Rules](https://semver.org), but note you don't need

.github/README.md.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ of SQLCipher and embed it in GRDB.swift:
3939

4040
The script will also:
4141
* present the summary of updated versions and ask you to pick the new version number for DuckDuckGo GRDB fork,
42+
* test the build,
4243
* create a new release branch and commit changes.
4344

4445
For versioning, follow [Semantic Versioning Rules](https://semver.org), but note you don't need

setup_sqlcipher.sh

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,13 @@ update_readme() {
6262
grdb_tag="$(git describe --tags --abbrev=0 --match=v* upstream-master)"
6363

6464
new_version=
65-
echo "DuckDuckGo GRDB.swift current version: ${current_version}"
66-
echo "Upstream GRDB.swift version: ${current_upstream_version} -> ${grdb_tag}"
67-
echo "SQLCipher version: ${current_sqlcipher_version} -> ${sqlcipher_tag}"
65+
cat <<- EOF
66+
67+
DuckDuckGo GRDB.swift current version: ${current_version}
68+
Upstream GRDB.swift version: ${current_upstream_version} -> ${grdb_tag#v}
69+
SQLCipher version: ${current_sqlcipher_version} -> ${sqlcipher_tag#v}
70+
EOF
71+
6872
while ! [[ "${new_version}" =~ [0-9]\.[0-9]\.[0-9] ]]; do
6973
read -rp "Input DuckDuckGo GRDB.swift desired version number (x.y.z): " new_version < /dev/tty
7074
done
@@ -76,26 +80,32 @@ update_readme() {
7680
echo "Updated .github/README.md ✅"
7781
}
7882

83+
build_release() {
84+
echo "Testing the build ..."
85+
rm -rf "${cwd}/.build"
86+
swift build -c release
87+
88+
echo "SQLCipher ${sqlcipher_tag} is ready to use with GRDB.swift ${grdb_tag} 🎉"
89+
}
90+
7991
setup_new_release_branch() {
8092
echo "Setting up new release branch ..."
8193

82-
git checkout -b "release/${new_version}-grdb-${grdb_tag#v}-sqlcipher-${sqlcipher_tag#v}"
83-
git add \
84-
"${cwd}/.github/README.md" \
85-
"${cwd}/GRDB/Export.swift" \
86-
"${cwd}/Package.swift" \
87-
"${cwd}/Sources/CSQLite" \
88-
"$sqlcipher_path"
94+
local release_branch="release/${new_version}"
95+
96+
git checkout -b "$release_branch"
97+
git commit -a -m "DuckDuckGo GRDB.swift ${new_version} (GRDB ${upstream-version}, SQLCipher ${sqlcipher_version})"
8998

99+
echo "Release is prepared on branch ${release_branch}."
100+
echo "Push the branch when ready and follow .github/README.md for release instructions."
90101
}
91102

92103
main() {
93104
build_sqlcipher
94105
update_sqlcipher_config
95106
update_readme
96-
#setup_new_release_branch
97-
98-
echo "SQLCipher ${sqlcipher_tag} is ready to use with GRDB.swift ${grdb_tag} 🎉"
107+
build_release
108+
setup_new_release_branch
99109
}
100110

101111
main

0 commit comments

Comments
 (0)