Skip to content

Commit 6aa60dd

Browse files
committed
Run unit tests in prepare_release.sh
1 parent 5be8a1c commit 6aa60dd

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

.github/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,16 @@ to use the same version as GRDB. Examples:
5555
* Upstream GRDB 5.12.0, after merge -> 6.0.0
5656
* This project 1.1.0 -> 2.0.0
5757

58-
If everything looks fine, push your branch, create PR for BSK referencing your new branch,
59-
and then create PRs for iOS and macOS apps referencing your BSK branch.
60-
61-
Once merged, tag the branch with a version picked earlier and push the tag.
58+
If everything looks fine:
59+
* push your branch,
60+
* create PR for BSK referencing the new branch,
61+
* create PRs for iOS and macOS apps referencing your BSK branch.
62+
63+
Once approved:
64+
* merge your branch back to `SQLCipher`,
65+
* create a tag matching the release number **without the 'v' prefix** (those are reserved for upstream),
66+
* push the tag,
67+
* update the reference to GRDB in BSK to point to a tag.
6268

6369
# Compiling SQLCipher manually
6470

.github/README.md.in

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,16 @@ to use the same version as GRDB. Examples:
5555
* Upstream GRDB 5.12.0, after merge -> 6.0.0
5656
* This project 1.1.0 -> 2.0.0
5757

58-
If everything looks fine, push your branch, create PR for BSK referencing your new branch,
59-
and then create PRs for iOS and macOS apps referencing your BSK branch.
60-
61-
Once merged, tag the branch with a version picked earlier and push the tag.
58+
If everything looks fine:
59+
* push your branch,
60+
* create PR for BSK referencing the new branch,
61+
* create PRs for iOS and macOS apps referencing your BSK branch.
62+
63+
Once approved:
64+
* merge your branch back to `SQLCipher`,
65+
* create a tag matching the release number **without the 'v' prefix** (those are reserved for upstream),
66+
* push the tag,
67+
* update the reference to GRDB in BSK to point to a tag.
6268

6369
### Compiling SQLCipher manually
6470

prepare_release.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ build_sqlcipher() {
3535
echo ""
3636

3737
printf '%s' "Building SQLCipher ... "
38-
eval make sqlite3.c "$mute"
38+
ncpu=$(sysctl -n hw.ncpu 2>/dev/null || echo "1")
39+
eval make -j"${ncpu}" sqlite3.c "$mute"
3940
echo ""
4041

4142
eval popd "$mute" || { echo "popd failed"; exit 1; }
@@ -69,7 +70,6 @@ update_readme() {
6970
exit 1
7071
fi
7172

72-
new_version=
7373
cat <<- EOF
7474
7575
DuckDuckGo GRDB.swift current version: ${current_version}
@@ -87,9 +87,15 @@ update_readme() {
8787
echo "Updated .github/README.md ✅"
8888
}
8989

90-
build_release() {
90+
build_and_test_release() {
9191
echo "Testing the build ..."
9292
rm -rf "${cwd}/.build"
93+
# The skipped test references a test database added with a podfile.
94+
# We're safe to disable it since we don't care about SQLCipher 3 compatibility anyway.
95+
swift test --skip "EncryptionTests.testSQLCipher3Compatibility"
96+
97+
echo ""
98+
echo "Building using release configuration ..."
9399
swift build -c release
94100

95101
cat <<- EOF
@@ -105,7 +111,7 @@ setup_new_release_branch() {
105111
local release_branch="release/${new_version}"
106112

107113
git checkout -b "$release_branch"
108-
git commit -a -m "DuckDuckGo GRDB.swift ${new_version} (GRDB ${upstream-version}, SQLCipher ${sqlcipher_version})"
114+
git commit "$sqlcipher_path" -m "DuckDuckGo GRDB.swift ${new_version} (GRDB ${upstream-version}, SQLCipher ${sqlcipher_version})"
109115

110116
cat <<- EOF
111117
@@ -118,7 +124,7 @@ main() {
118124
build_sqlcipher
119125
update_sqlcipher_config
120126
update_readme
121-
build_release
127+
build_and_test_release
122128
setup_new_release_branch
123129
}
124130

0 commit comments

Comments
 (0)