Skip to content

Commit 2a381d1

Browse files
committed
add linux + mac builds for ci
1 parent 2c0e354 commit 2a381d1

2 files changed

Lines changed: 72 additions & 3 deletions

File tree

.github/workflows/build.yml

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
MIN_SDK: 21
1414

1515
jobs:
16-
build:
16+
build-android:
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
@@ -64,10 +64,71 @@ jobs:
6464
with:
6565
name: sqlcipher-${{ matrix.toolchain }}
6666
path: sqlcipher/libsqlite3.so
67+
68+
build-linux:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
with:
74+
submodules: true
75+
76+
- name: Build OpenSSL
77+
run: |
78+
cd openssl
79+
./Configure -static -fpic -no-shared -no-fuzz-afl -no-fuzz-libfuzzer -no-tests -no-apps -ffunction-sections -fdata-sections
80+
make -j 4
81+
82+
- name: Build SQLCipher
83+
run: |
84+
OPENSSL_HEADERS=$(realpath openssl/include)
85+
OPENSSL_LIB=$(realpath openssl/libcrypto.a)
86+
87+
cd sqlcipher
88+
./configure --with-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_EXTRA_INIT=sqlcipher_extra_init -DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown -I$OPENSSL_HEADERS" LDFLAGS="$OPENSSL_LIB"
89+
make -j 4
90+
91+
- name: Upload artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: sqlcipher-linux
95+
path: sqlcipher/libsqlite3.so
96+
97+
build-mac:
98+
runs-on: macos-latest
99+
steps:
100+
- name: Checkout
101+
uses: actions/checkout@v4
102+
with:
103+
submodules: true
104+
105+
- name: Build OpenSSL
106+
run: |
107+
cd openssl
108+
./Configure -static -fpic -no-shared -no-fuzz-afl -no-fuzz-libfuzzer -no-tests -no-apps -ffunction-sections -fdata-sections
109+
make -j 4
110+
111+
- name: Build SQLCipher
112+
run: |
113+
OPENSSL_HEADERS=$(realpath openssl/include)
114+
OPENSSL_LIB=$(realpath openssl/libcrypto.a)
115+
116+
cd sqlcipher
117+
./configure --with-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_EXTRA_INIT=sqlcipher_extra_init -DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown -I$OPENSSL_HEADERS" LDFLAGS="$OPENSSL_LIB"
118+
make -j 4
119+
120+
- name: Upload artifact
121+
uses: actions/upload-artifact@v4
122+
with:
123+
name: sqlcipher-mac
124+
path: sqlcipher/libsqlite3.dylib
67125

68126
package:
69127
runs-on: ubuntu-latest
70-
needs: build
128+
needs:
129+
- build-android
130+
- build-linux
131+
- build-mac
71132

72133
steps:
73134
- name: Checkout
@@ -86,6 +147,12 @@ jobs:
86147

87148
- name: Build
88149
run: |
150+
mkdir -p "Stratum.SQLCipher/runtimes/linux-x64"
151+
cp "artifacts/sqlcipher-linux/libsqlite3.so" "Stratum.SQLCipher/runtimes/linux-x64/libsqlcipher.so"
152+
153+
mkdir -p "Stratum.SQLCipher/runtimes/osx"
154+
cp "artifacts/sqlcipher-mac/libsqlite3.dylib" "Stratum.SQLCipher/runtimes/osx/libsqlcipher.dylib"
155+
89156
mkdir -p "Stratum.SQLCipher/runtimes/android-arm64-v8a"
90157
cp "artifacts/sqlcipher-aarch64-linux-android/libsqlite3.so" "Stratum.SQLCipher/runtimes/android-arm64-v8a/libsqlcipher.so"
91158

Stratum.SQLCipher/Stratum.SQLCipher.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77

88
<PackageId>StratumAuth.SQLCipher</PackageId>
9-
<Version>1.0.0</Version>
9+
<Version>1.1.0</Version>
1010
<Authors>jamie-mh</Authors>
1111
<Copyright>Copyright (c) jamie-mh 2025</Copyright>
1212
<ProjectUrl>https://stratumauth.com</ProjectUrl>
@@ -19,6 +19,8 @@
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22+
<None Include="runtimes/linux-x64/libsqlcipher.so" PackagePath="runtimes/linux-x64/native/" Pack="true" />
23+
<None Include="runtimes/osx/libsqlcipher.dylib" PackagePath="runtimes/osx/native/" Pack="true" />
2224
<None Include="runtimes/android-arm64-v8a/libsqlcipher.so" PackagePath="runtimes/android-arm64/native/" Pack="true" />
2325
<None Include="runtimes/android-armeabi-v7a/libsqlcipher.so" PackagePath="runtimes/android-arm/native/" Pack="true" />
2426
<None Include="runtimes/android-x86_64/libsqlcipher.so" PackagePath="runtimes/android-x64/native/" Pack="true" />

0 commit comments

Comments
 (0)