|
| 1 | +name: build sqlitesync |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + name: build for ${{ matrix.name }}-${{ matrix.arch }} |
| 11 | + timeout-minutes: 20 |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + matrix: |
| 15 | + include: |
| 16 | + - os: ubuntu-latest |
| 17 | + arch: x86_64 |
| 18 | + configure: --with-openssl |
| 19 | + name: linux |
| 20 | + - os: LinuxARM64 |
| 21 | + arch: arm64 |
| 22 | + configure: --with-openssl |
| 23 | + name: linux |
| 24 | + - os: macos-latest |
| 25 | + arch: arm64 |
| 26 | + configure: --with-secure-transport |
| 27 | + name: macos |
| 28 | + - os: macos-13 |
| 29 | + arch: x86_64 |
| 30 | + configure: --with-secure-transport |
| 31 | + name: macos |
| 32 | + - os: windows-latest |
| 33 | + arch: x86_64 |
| 34 | + configure: --with-schannel |
| 35 | + name: windows |
| 36 | + - os: ubuntu-latest |
| 37 | + arch: arm64 |
| 38 | + configure: |
| 39 | + --host aarch64-linux-android26 |
| 40 | + --with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr |
| 41 | + LIBS="-lssl -lcrypto -lc++" |
| 42 | + AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar |
| 43 | + AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as |
| 44 | + CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang |
| 45 | + CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang++ |
| 46 | + LD=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/ld |
| 47 | + RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib |
| 48 | + STRIP=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip |
| 49 | + name: android |
| 50 | + - os: ubuntu-latest |
| 51 | + arch: x86_64 |
| 52 | + configure: |
| 53 | + --host x86_64-linux-android26 |
| 54 | + --with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr |
| 55 | + LIBS="-lssl -lcrypto -lc++" |
| 56 | + AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar |
| 57 | + AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as |
| 58 | + CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang |
| 59 | + CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang++ |
| 60 | + LD=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/ld |
| 61 | + RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib |
| 62 | + STRIP=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip |
| 63 | + name: android |
| 64 | + - os: macos-latest |
| 65 | + arch: arm64 |
| 66 | + configure: |
| 67 | + --host=arm64-apple-darwin |
| 68 | + --with-secure-transport |
| 69 | + CFLAGS="-arch arm64 -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0" |
| 70 | + name: ios |
| 71 | + - os: macos-latest |
| 72 | + arch: arm64 |
| 73 | + configure: |
| 74 | + --host=arm64-apple-darwin |
| 75 | + --with-secure-transport |
| 76 | + CFLAGS="-arch arm64 -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0" |
| 77 | + name: isim |
| 78 | + - os: macos-latest |
| 79 | + arch: x86_64 |
| 80 | + configure: |
| 81 | + --host=x86_64-apple-darwin |
| 82 | + --with-secure-transport |
| 83 | + CFLAGS="-arch x86_64 -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0" |
| 84 | + name: isim |
| 85 | + |
| 86 | + defaults: |
| 87 | + run: |
| 88 | + shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} |
| 89 | + env: |
| 90 | + MAKEFLAGS: -j 8 |
| 91 | + |
| 92 | + steps: |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + if: matrix.os == 'windows-latest' |
| 98 | + with: |
| 99 | + msystem: mingw64 |
| 100 | + install: >- |
| 101 | + mingw-w64-x86_64-cc |
| 102 | + mingw-w64-x86_64-autotools make |
| 103 | +
|
| 104 | + - uses: robinraju/[email protected] |
| 105 | + with: |
| 106 | + repository: curl/curl |
| 107 | + tag: 'curl-8_12_1' |
| 108 | + extract: true |
| 109 | + fileName: curl-*.tar.gz |
| 110 | + |
| 111 | + - name: build boringssl |
| 112 | + if: matrix.name == 'android' |
| 113 | + run: | |
| 114 | + git clone https://boringssl.googlesource.com/boringssl |
| 115 | + cd boringssl |
| 116 | + mkdir build |
| 117 | + cd build |
| 118 | + cmake \ |
| 119 | + -DANDROID_ABI=${{ matrix.arch == 'arm64' && 'arm64-v8a' || 'x86_64' }} \ |
| 120 | + -DANDROID_PLATFORM=android-26 \ |
| 121 | + -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \ |
| 122 | + -DOPENSSL_SMALL=1 \ |
| 123 | + -DCMAKE_BUILD_TYPE=Release \ |
| 124 | + .. |
| 125 | + make |
| 126 | +
|
| 127 | + cd .. |
| 128 | + TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64" |
| 129 | + cp build/libssl.a $TOOLCHAIN/sysroot/usr/lib/ |
| 130 | + cp build/libcrypto.a $TOOLCHAIN/sysroot/usr/lib/ |
| 131 | + cp -r include/openssl $TOOLCHAIN/sysroot/usr/include/ |
| 132 | + |
| 133 | + - name: build curl |
| 134 | + run: | |
| 135 | + |
| 136 | + folder=$(ls -d curl-*/ 2>/dev/null | head -n 1) |
| 137 | + cd $folder |
| 138 | +
|
| 139 | + ./configure \ |
| 140 | + --without-libpsl \ |
| 141 | + --disable-alt-svc \ |
| 142 | + --disable-ares \ |
| 143 | + --disable-cookies \ |
| 144 | + --disable-basic-auth \ |
| 145 | + --disable-digest-auth \ |
| 146 | + --disable-kerberos-auth \ |
| 147 | + --disable-negotiate-auth \ |
| 148 | + --disable-aws \ |
| 149 | + --disable-dateparse \ |
| 150 | + --disable-dnsshuffle \ |
| 151 | + --disable-doh \ |
| 152 | + --disable-form-api \ |
| 153 | + --disable-hsts \ |
| 154 | + --disable-ipv6 \ |
| 155 | + --disable-libcurl-option \ |
| 156 | + --disable-manual \ |
| 157 | + --disable-mime \ |
| 158 | + --disable-netrc \ |
| 159 | + --disable-ntlm \ |
| 160 | + --disable-ntlm-wb \ |
| 161 | + --disable-progress-meter \ |
| 162 | + --disable-proxy \ |
| 163 | + --disable-pthreads \ |
| 164 | + --disable-socketpair \ |
| 165 | + --disable-threaded-resolver \ |
| 166 | + --disable-tls-srp \ |
| 167 | + --disable-verbose \ |
| 168 | + --disable-versioned-symbols \ |
| 169 | + --enable-symbol-hiding \ |
| 170 | + --without-brotli \ |
| 171 | + --without-zstd \ |
| 172 | + --without-libidn2 \ |
| 173 | + --without-librtmp \ |
| 174 | + --without-zlib \ |
| 175 | + --without-nghttp2 \ |
| 176 | + --without-ngtcp2 \ |
| 177 | + --disable-shared \ |
| 178 | + --disable-ftp \ |
| 179 | + --disable-file \ |
| 180 | + --disable-ipfs \ |
| 181 | + --disable-ldap \ |
| 182 | + --disable-ldaps \ |
| 183 | + --disable-rtsp \ |
| 184 | + --disable-dict \ |
| 185 | + --disable-telnet \ |
| 186 | + --disable-tftp \ |
| 187 | + --disable-pop3 \ |
| 188 | + --disable-imap \ |
| 189 | + --disable-smb \ |
| 190 | + --disable-smtp \ |
| 191 | + --disable-gopher \ |
| 192 | + --disable-mqtt \ |
| 193 | + --disable-docs \ |
| 194 | + --enable-static \ |
| 195 | + ${{matrix.configure}} |
| 196 | + make |
| 197 | + |
| 198 | + # save avg 1kb more with these options |
| 199 | + # --disable-debug \ |
| 200 | + # --enable-optimize \ |
| 201 | + # --disable-curldebug \ |
| 202 | + # --disable-get-easy-options \ |
| 203 | + # --without-fish-functions-dir \ |
| 204 | + # --without-zsh-functions-dir \ |
| 205 | + # --without-libgsasl \ |
| 206 | +
|
| 207 | + cd .. |
| 208 | + mkdir -p network/curl/${{ matrix.name }} |
| 209 | + mv $folder/lib/.libs/libcurl.a network/curl/${{ matrix.name }}/lib${{matrix.arch}}.a |
| 210 | +
|
| 211 | + |
| 212 | + with: |
| 213 | + name: libcurl-${{ matrix.name }}-${{ matrix.arch }} |
| 214 | + path: network/curl/${{ matrix.name }}/lib${{matrix.arch}}.a |
| 215 | + if-no-files-found: error |
| 216 | + |
| 217 | + - name: build sqlitesync |
| 218 | + run: | |
| 219 | + echo "TODO: build sqlitesync" |
0 commit comments