Skip to content

Commit

Permalink
Update prepare_release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoy committed Feb 19, 2023
1 parent 074a963 commit efabc84
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 60 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,4 @@ Tests/products

upstream
GRDB.xcframework
GRDB.xcframework.zip
23 changes: 23 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "GRDB",
platforms: [
.iOS(.v11),
.macOS(.v10_15),
],
products: [
.library(name: "GRDB", targets: ["GRDB", "_GRDBDummy"]),
],
targets: [
.binaryTarget(
name: "GRDB",
url: "https://github.com/DuckDuckGo/GRDB.swift/releases/download/0.0.1/GRDB.xcframework.zip",
checksum: "448ec3b0b60c0484a7efad9bbc915c21e79231ab9a33e39e6f7539fc4e19c1ca"
),
.target(name: "_GRDBDummy")
]
)
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# GRDB + SQLCipher

## What is this?
This is a fork of [GRDB](https://github.com/groue/GRDB.swift) which contains a [SQLCipher Community Edition](https://www.zetetic.net/sqlcipher/open-source/) amalgamation packaged so that it can be consumed as a Swift Package.

The default branch for this repository is `SQLCipher` so that we can more easily pull upstream changes if we need to.

## Versioning

* This Package: *2.0.0*
* GRDB: *6.0.0*
* SQLCipher: *4.5.3*

## Contributions
We do not accept contributions to this repository at this time. However, feel free to open an issue in order to start a discussion.

## We are hiring!
DuckDuckGo is growing fast and we continue to expand our fully distributed team. We embrace diverse perspectives, and seek out passionate, self-motivated people, committed to our shared vision of raising the standard of trust online. If you are a senior software engineer capable in either iOS or Android, visit our [careers](https://duckduckgo.com/hiring/#open) page to find out more about our openings!

## Updating from Upstream

Add remote upstream:

* `git remote add upstream [email protected]:groue/GRDB.swift.git`

Check out upstream's master branch locally:

* `git fetch upstream +master:upstream-master && git checkout upstream-master`

Update upstream's master branch if needed:

* `git pull upstream master`

Switch back to the `SQLCipher` branch and merge with upstream-master:

* `git merge upstream-master`

Resolve any conflicts that may occur (normally there should be none or only in Package.swift)
and commit the merge. Once done, run `prepare_release.sh` script to fetch and compile the latest tag
of SQLCipher and embed it in GRDB.swift:

* `./prepare_release.sh`

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

For versioning, follow [Semantic Versioning Rules](https://semver.org), but note you don't need
to use the same version as GRDB. Examples:

* Upstream GRDB 5.6.0, after merge -> 5.12.0
* This project 1.0.0 -> 1.1.0

* Upstream GRDB 5.12.0, after merge -> 6.0.0
* This project 1.1.0 -> 2.0.0

If everything looks fine:
* push your branch,
* create PR for BSK referencing the new branch,
* create PRs for iOS and macOS apps referencing your BSK branch.

Once approved:
* merge your branch back to `SQLCipher`,
* create a tag matching the release number **without the 'v' prefix** (those are reserved for upstream),
* push the tag,
* update the reference to GRDB in BSK to point to a tag.

### Compiling SQLCipher manually

In case `prepare_release.sh` script fails, you need to compile SQLCipher amalgamation package
manually. See [general instructions](https://github.com/sqlcipher/sqlcipher#compiling-for-unix-like-systems):

* Use `./configure --with-crypto-lib=none`.
* Remember to use `make sqlite3.c` and not `make`.
* Copy `sqlite3.c` and `sqlite3.h` to `Sources/SQLCipher/sqlite3.c` and `Sources/SQLCipher/include/sqlite3.h`.
1 change: 1 addition & 0 deletions Sources/_GRDBDummy/_GRDBDummy.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

23 changes: 23 additions & 0 deletions assets/Package.swift.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "GRDB",
platforms: [
.iOS(.v11),
.macOS(.v10_15),
],
products: [
.library(name: "GRDB", targets: ["GRDB", "_GRDBDummy"]),
],
targets: [
.binaryTarget(
name: "GRDB",
url: "https://github.com/DuckDuckGo/GRDB.swift/releases/download/${new_version}/GRDB.xcframework.zip",
checksum: "${checksum}"
),
.target(name: "_GRDBDummy")
]
)
Loading

0 comments on commit efabc84

Please sign in to comment.