forked from mattsta/signal-backup
-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vendor sqlcipher and build pysqlcipher3 amalgamation (#135)
* move code into src * matrixify py version * add sqlcipher build script * add build script * vendor sqlcipher * only one matrix build * without cibuild * fix rename * fix upload path * multi arch * add setuptools * failfast=false * multi linux python * single py version * try again for mac * cd * remove Dockerfile * pytest * single cicd * fix * try this * try this * rename macos wheel * add sdist * add sqlcipher readme * rename
- Loading branch information
Showing
26 changed files
with
275,017 additions
and
181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: build ${{ matrix.os }} ${{ matrix.py }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest"] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: prep pysqlcipher3 | ||
run: | | ||
git clone --depth=1 --branch=master https://github.com/rigglemania/pysqlcipher3.git | ||
cd pysqlcipher3 | ||
mkdir amalgamation | ||
cp ../sqlcipher/sqlite3.[ch] amalgamation | ||
mkdir src/python3/sqlcipher | ||
cp ../sqlcipher/sqlite3.[ch] src/python3/sqlcipher | ||
pip install setuptools | ||
- name: build pysqlcipher3 linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
cd pysqlcipher3 | ||
python setup.py build_amalgamation | ||
python setup.py build | ||
- name: build pysqlcipher3 macOS | ||
if: matrix.os == 'macos-latest' | ||
run: | | ||
brew install openssl | ||
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib" | ||
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include" | ||
cd pysqlcipher3 | ||
python setup.py build_amalgamation | ||
python setup.py build | ||
- name: post-build pysqlcipher3 | ||
run: | | ||
mkdir src/pysqlcipher3 | ||
for f in pysqlcipher3/build/lib.*/pysqlcipher3/*.{py,so}; do cp $f src/pysqlcipher3/; done | ||
- name: build | ||
run: | | ||
pip install build | ||
python -m build | ||
PLATFORM_TAG=$(python -c 'import sysconfig; print(sysconfig.get_platform().replace("-", "_").replace(".", "_"))') | ||
cd dist | ||
NEW_NAME=$(ls *.whl | sed "s/any.whl$/${PLATFORM_TAG}.whl/") | ||
mv *.whl $NEW_NAME | ||
echo "WHEEL_NAME=$(ls *.whl)" >> $GITHUB_ENV | ||
echo "SDIST_NAME=$(ls *.tar.gz)" >> $GITHUB_ENV | ||
- name: test | ||
run: | | ||
pip install dist/*.whl pytest | ||
pytest | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.WHEEL_NAME }} | ||
path: "dist/*.whl" | ||
|
||
- uses: actions/upload-artifact@v4 | ||
# only do this once | ||
if: matrix.os == 'ubuntu-latest' | ||
with: | ||
name: ${{ env.SDIST_NAME }} | ||
path: "dist/*.tar.gz" | ||
|
||
upload: | ||
needs: [build] | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
|
||
- name: Copy artifacts to dist/ folder | ||
run: | | ||
mkdir -p dist/ | ||
find . -name '*.tar.gz' -exec mv '{}' dist/ \; | ||
find . -name '*.whl' -exec mv '{}' dist/ \; | ||
- name: Upload | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip_existing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Custom | ||
src/pysqlcipher3 | ||
|
||
# OS generated files | ||
.DS_Store | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# sqlcipher | ||
|
||
Copyright belongs to [SQLite](https://www.sqlite.org/) and [Zetetic](https://github.com/sqlcipher/sqlcipher?tab=License-1-ov-file). | ||
|
||
This is a vendored amalgamation build of SQLCipher, built as follows: | ||
```bash | ||
apt-get update | ||
apt-get install -y git gcc libsqlite3-dev tclsh libssl-dev libc6-dev make | ||
|
||
git clone --depth=1 --branch=master https://github.com/sqlcipher/sqlcipher.git | ||
cd sqlcipher | ||
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto -lsqlite3" | ||
make sqlite3.c | ||
``` |
Oops, something went wrong.