Skip to content

Commit 5cc83ce

Browse files
committed
Merge branch 'main' into test/android
2 parents 653d91c + 5806499 commit 5cc83ce

File tree

15 files changed

+808
-438
lines changed

15 files changed

+808
-438
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -18,78 +18,34 @@ jobs:
1818
include:
1919
- os: ubuntu-latest
2020
arch: x86_64
21-
configure: --with-openssl
2221
name: linux
2322
- os: LinuxARM64
2423
arch: arm64
25-
configure: --with-openssl
2624
name: linux
2725
- os: macos-latest
28-
configure:
29-
--with-secure-transport
30-
CFLAGS="-arch x86_64 -arch arm64"
3126
name: macos
3227
- os: windows-latest
3328
arch: x86_64
34-
configure:
35-
--with-schannel
36-
CFLAGS="-DCURL_STATICLIB"
3729
name: windows
3830
- os: ubuntu-latest
3931
arch: arm64-v8a
40-
configure:
41-
--host aarch64-linux-android26
42-
--with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr
43-
LIBS="-lssl -lcrypto"
44-
AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
45-
AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as
46-
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang
47-
CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang++
48-
LD=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/ld
49-
RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
50-
STRIP=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip
5132
name: android
52-
make:
53-
PLATFORM=android
54-
CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang
33+
make: PLATFORM=android ARCH=arm64-v8a
5534
- os: ubuntu-latest
5635
arch: x86_64
57-
configure:
58-
--host x86_64-linux-android26
59-
--with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr
60-
LIBS="-lssl -lcrypto"
61-
AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
62-
AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as
63-
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang
64-
CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang++
65-
LD=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/ld
66-
RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
67-
STRIP=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip
6836
name: android
69-
make:
70-
PLATFORM=android
71-
CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang
37+
make: PLATFORM=android ARCH=x86_64
7238
sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
7339
- os: macos-latest
74-
configure:
75-
--host=arm64-apple-darwin
76-
--with-secure-transport
77-
CFLAGS="-arch arm64 -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0"
7840
name: ios
7941
make: PLATFORM=ios
8042
- os: macos-latest
81-
configure:
82-
--host=arm64-apple-darwin
83-
--with-secure-transport
84-
CFLAGS="-arch x86_64 -arch arm64 -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0"
8543
name: isim
8644
make: PLATFORM=isim
8745

8846
defaults:
8947
run:
90-
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
91-
env:
92-
MAKEFLAGS: -j 8
48+
shell: bash
9349

9450
steps:
9551

@@ -101,123 +57,19 @@ jobs:
10157
msystem: mingw64
10258
install: >-
10359
mingw-w64-x86_64-cc
104-
mingw-w64-x86_64-autotools make
105-
106-
- uses: robinraju/[email protected]
107-
with:
108-
repository: curl/curl
109-
tag: 'curl-8_12_1'
110-
extract: true
111-
fileName: curl-*.tar.gz
112-
113-
- name: build openssl
114-
if: matrix.name == 'android'
115-
run: |
116-
git clone https://github.com/openssl/openssl.git
117-
cd openssl
118-
export TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
119-
export ARCH=${{ matrix.arch }}
120-
export PATH=$TOOLCHAIN/bin:$PATH
121-
122-
./Configure android-${{ matrix.arch == 'arm64-v8a' && 'arm64' || matrix.arch }} \
123-
--prefix=$PWD/build \
124-
--openssldir=$PWD/build/ssl \
125-
no-shared \
126-
no-unit-test \
127-
-D__ANDROID_API__=26
128-
make
129-
make install_sw
130-
131-
cp build/lib/libssl.a $TOOLCHAIN/sysroot/usr/lib/
132-
cp build/lib/libcrypto.a $TOOLCHAIN/sysroot/usr/lib/
133-
cp -r build/include/openssl $TOOLCHAIN/sysroot/usr/include/
134-
135-
- name: build curl
136-
run: |
137-
138-
folder=$(ls -d curl-*/ 2>/dev/null | head -n 1)
139-
cd $folder
60+
make
14061
141-
./configure \
142-
--without-libpsl \
143-
--disable-alt-svc \
144-
--disable-ares \
145-
--disable-cookies \
146-
--disable-basic-auth \
147-
--disable-digest-auth \
148-
--disable-kerberos-auth \
149-
--disable-negotiate-auth \
150-
--disable-aws \
151-
--disable-dateparse \
152-
--disable-dnsshuffle \
153-
--disable-doh \
154-
--disable-form-api \
155-
--disable-hsts \
156-
--disable-ipv6 \
157-
--disable-libcurl-option \
158-
--disable-manual \
159-
--disable-mime \
160-
--disable-netrc \
161-
--disable-ntlm \
162-
--disable-ntlm-wb \
163-
--disable-progress-meter \
164-
--disable-proxy \
165-
--disable-pthreads \
166-
--disable-socketpair \
167-
--disable-threaded-resolver \
168-
--disable-tls-srp \
169-
--disable-verbose \
170-
--disable-versioned-symbols \
171-
--enable-symbol-hiding \
172-
--without-brotli \
173-
--without-zstd \
174-
--without-libidn2 \
175-
--without-librtmp \
176-
--without-zlib \
177-
--without-nghttp2 \
178-
--without-ngtcp2 \
179-
--disable-shared \
180-
--disable-ftp \
181-
--disable-file \
182-
--disable-ipfs \
183-
--disable-ldap \
184-
--disable-ldaps \
185-
--disable-rtsp \
186-
--disable-dict \
187-
--disable-telnet \
188-
--disable-tftp \
189-
--disable-pop3 \
190-
--disable-imap \
191-
--disable-smb \
192-
--disable-smtp \
193-
--disable-gopher \
194-
--disable-mqtt \
195-
--disable-docs \
196-
--enable-static \
197-
${{matrix.configure}}
198-
make
199-
200-
# save avg 1kb more with these options
201-
# --disable-debug \
202-
# --enable-optimize \
203-
# --disable-curldebug \
204-
# --disable-get-easy-options \
205-
# --without-fish-functions-dir \
206-
# --without-zsh-functions-dir \
207-
# --without-libgsasl \
208-
209-
cd ..
210-
mkdir -p curl/${{ matrix.name }}
211-
mv $folder/lib/.libs/libcurl.a curl/${{ matrix.name }}
62+
- name: windows build curl
63+
if: matrix.os == 'windows-latest'
64+
run: make curl/windows/libcurl.a -j4
65+
shell: msys2 {0}
21266

21367
- name: build sqlite-sync
214-
run: make ${{ matrix.make && matrix.make || ''}}
215-
shell: bash
68+
run: make extension ${{ matrix.make && matrix.make || ''}} -j4
21669

21770
- name: windows install sqlite3
21871
if: matrix.os == 'windows-latest'
21972
run: choco install sqlite -y
220-
shell: bash
22173

22274
- name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION
22375
if: matrix.name == 'macos'
@@ -237,17 +89,17 @@ jobs:
23789
curl -O ${{ matrix.sqlite-amalgamation-zip }}
23890
unzip sqlite-amalgamation-*.zip
23991
export ${{ matrix.make }}
240-
$CC sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl
92+
$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/${{ matrix.arch }}-linux-android26-clang sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl
24193
# remove unused folders to save up space
242-
rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* curl-* openssl
94+
rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* openssl
24395
echo "::endgroup::"
24496
24597
echo "::group::prepare the test script"
246-
make test CC=$CC PLATFORM=$PLATFORM || echo "It should fail. Running remaining commands in the emulator"
98+
make test PLATFORM=$PLATFORM ARCH=$ARCH -j4 || echo "It should fail. Running remaining commands in the emulator"
24799
cat > commands.sh << EOF
248100
mv -f /data/local/tmp/sqlite3 /system/xbin
249101
cd /data/local/tmp
250-
$(make test CC=$CC PLATFORM=$PLATFORM -n)
102+
$(make test PLATFORM=$PLATFORM ARCH=$ARCH -n)
251103
EOF
252104
echo "::endgroup::"
253105
@@ -265,8 +117,7 @@ jobs:
265117
266118
- name: test sqlite-sync
267119
if: matrix.name == 'linux' || matrix.name == 'windows'
268-
run: make test
269-
shell: bash
120+
run: make test -j4
270121

271122
- name: test sqlite-sync + coverage
272123
if: matrix.name == 'macos'
@@ -313,7 +164,12 @@ jobs:
313164
FILE="src/cloudsync.h"
314165
VERSION=$(grep -oP '#define CLOUDSYNC_VERSION\s+"\K[^"]+' "$FILE")
315166
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
316-
echo "version=$VERSION" >> $GITHUB_OUTPUT
167+
LATEST=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.name')
168+
if [[ "$VERSION" != "$LATEST" ]]; then
169+
echo "version=$VERSION" >> $GITHUB_OUTPUT
170+
else
171+
echo "::warning file=src/cloudsync.h::To release a new version, please update the CLOUDSYNC_VERSION in src/cloudsync.h to be different than the latest $LATEST"
172+
fi
317173
exit 0
318174
fi
319175
echo "❌ CLOUDSYNC_VERSION not found in cloudsync.h"
@@ -333,6 +189,7 @@ jobs:
333189
done
334190
335191
- uses: softprops/[email protected]
192+
if: steps.tag.outputs.version != ''
336193
with:
337194
generate_release_notes: true
338195
tag_name: ${{ steps.tag.outputs.version }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
/dist
88
/coverage
99
*.sqlite
10-
*.a
10+
*.a
11+
unittest
12+
/curl/src

0 commit comments

Comments
 (0)