-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (138 loc) Β· 5.68 KB
/
Copy pathbuild.yml
File metadata and controls
170 lines (138 loc) Β· 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Build
on:
push:
branches:
- master
workflow_dispatch:
env:
FRAMEWORK: net10.0
CONFIGURATION: Release
DOTNET_CLI_TELEMETRY_OPTOUT: true
MIN_SDK: 23
jobs:
build-android:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- aarch64-linux-android
- armv7a-linux-androideabi
- x86_64-linux-android
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build OpenSSL
run: |
declare -A TARGETS
TARGETS["aarch64-linux-android"]=android-arm64
TARGETS["armv7a-linux-androideabi"]=android-arm
TARGETS["x86_64-linux-android"]=android-x86_64
TARGETS["i686-linux-android"]=android-x86
TOOLCHAIN="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64"
export PATH="$TOOLCHAIN/bin:$PATH"
cd openssl
./Configure ${TARGETS[${{ matrix.toolchain }}]} -D__ANDROID_API__=$MIN_SDK -static -fpic -no-shared -no-fuzz-afl -no-fuzz-libfuzzer -no-tests -no-apps -ffunction-sections -fdata-sections '-Wno-macro-redefined'
make -j 4
- name: Build SQLCipher
run: |
TOOLCHAIN="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64"
TARGET="${{ matrix.toolchain }}$MIN_SDK"
OPENSSL_HEADERS=$(realpath openssl/include)
OPENSSL_LIB=$(realpath openssl/libcrypto.a)
export CC="$TOOLCHAIN/bin/clang --target=$TARGET"
export CXX="$TOOLCHAIN/bin/clang++ --target=$TARGET"
export LD="$TOOLCHAIN/bin/ld"
cd sqlcipher
./configure --with-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_EXTRA_INIT=sqlcipher_extra_init -DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown -D__ANDROID_API__=$MIN_SDK -I$OPENSSL_HEADERS" LDFLAGS="$OPENSSL_LIB -llog -Wl,-z,max-page-size=16384,--gc-sections"
make -j 4
"$TOOLCHAIN/bin/llvm-strip" libsqlite3.so
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sqlcipher-${{ matrix.toolchain }}
path: sqlcipher/libsqlite3.so
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build OpenSSL
run: |
cd openssl
./Configure -static -fpic -no-shared -no-fuzz-afl -no-fuzz-libfuzzer -no-tests -no-apps -ffunction-sections -fdata-sections
make -j 4
- name: Build SQLCipher
run: |
OPENSSL_HEADERS=$(realpath openssl/include)
OPENSSL_LIB=$(realpath openssl/libcrypto.a)
cd sqlcipher
./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"
make -j 4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sqlcipher-linux
path: sqlcipher/libsqlite3.so
build-mac:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build OpenSSL
run: |
cd openssl
./Configure -static -fpic -no-shared -no-fuzz-afl -no-fuzz-libfuzzer -no-tests -no-apps -ffunction-sections -fdata-sections
make -j 4
- name: Build SQLCipher
run: |
OPENSSL_HEADERS=$(realpath openssl/include)
OPENSSL_LIB=$(realpath openssl/libcrypto.a)
cd sqlcipher
./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"
make -j 4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: sqlcipher-mac
path: sqlcipher/libsqlite3.dylib
package:
runs-on: ubuntu-latest
needs:
- build-android
- build-linux
- build-mac
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10'
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: sqlcipher-*
path: artifacts
- name: Build
run: |
mkdir -p "Stratum.SQLCipher/runtimes/linux-x64"
cp "artifacts/sqlcipher-linux/libsqlite3.so" "Stratum.SQLCipher/runtimes/linux-x64/libsqlcipher.so"
mkdir -p "Stratum.SQLCipher/runtimes/osx"
cp "artifacts/sqlcipher-mac/libsqlite3.dylib" "Stratum.SQLCipher/runtimes/osx/libsqlcipher.dylib"
mkdir -p "Stratum.SQLCipher/runtimes/android-arm64-v8a"
cp "artifacts/sqlcipher-aarch64-linux-android/libsqlite3.so" "Stratum.SQLCipher/runtimes/android-arm64-v8a/libsqlcipher.so"
mkdir -p "Stratum.SQLCipher/runtimes/android-armeabi-v7a"
cp "artifacts/sqlcipher-armv7a-linux-androideabi/libsqlite3.so" "Stratum.SQLCipher/runtimes/android-armeabi-v7a/libsqlcipher.so"
mkdir -p "Stratum.SQLCipher/runtimes/android-x86_64"
cp "artifacts/sqlcipher-x86_64-linux-android/libsqlite3.so" "Stratum.SQLCipher/runtimes/android-x86_64/libsqlcipher.so"
dotnet build --configuration $CONFIGURATION Stratum.SQLCipher.sln
- name: Publish package
run: |
pkg=$(find Stratum.SQLCipher/bin/$CONFIGURATION/ -name '*.nupkg')
dotnet nuget push $pkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json