Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.git
cb/bld/bin
cb/bld/obj
112 changes: 68 additions & 44 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ on:
- 'bld/bin/**'

jobs:
build:
build-win-mac:
strategy:
matrix:
os: [ubuntu-20.04, macos-13, windows-2019]
os: [macos-13, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -25,14 +25,6 @@ jobs:
repository: libtom/libtomcrypt
path: "libtomcrypt"
ref: "v1.18.2"
- name: Setup cross compilers
if: startsWith(matrix.os, 'ubuntu')
run: ./cb/bld/setup_linux.sh
- name: Setup NDK
if: startsWith(matrix.os, 'ubuntu')
uses: nttld/setup-ndk@v1
with:
ndk-version: r21e
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand All @@ -44,29 +36,77 @@ jobs:
run: chmod +x *.sh
working-directory: cb/bld
- name: Clean output directory
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
if: startsWith(matrix.os, 'macos')
run: rm -fr bin
working-directory: cb/bld
- name: Clean output directory
if: startsWith(matrix.os, 'windows')
run: rm bin -r -fo
working-directory: cb/bld
- name: Build (Linux)
if: startsWith(matrix.os, 'ubuntu')
- name: Build (macOS, iOS, tvOS)
if: startsWith(matrix.os, 'macos')
run: |
#!/bin/bash
export PATH="$PWD/../../crosscompilers/bin:$PATH"
set -e
for f in linux_*.sh; do
if [[ "$f" == *_cross.sh ]] || [[ "$f" == *_regular.sh ]]
then
continue
fi
for f in mac_*.sh maccatalyst_*.sh ios_*.sh tvos_*.sh; do
bash "$f"
done
working-directory: cb/bld
- name: Build (Windows)
if: startsWith(matrix.os, 'windows')
run: |
$files = Get-ChildItem *.bat -Exclude "win_e_sqlite3.bat","win_e_sqlite3mc.bat","win_e_sqlcipher.bat","win_sqlite3mc.bat"
foreach ($f in $files) {
cmd /C $f
}
working-directory: cb/bld
- uses: actions/upload-artifact@v4
with:
name: bin-${{ matrix.os }}
path: cb/bld/bin

build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: "cb"
- uses: actions/checkout@v4
with:
repository: libtom/libtomcrypt
path: "libtomcrypt"
ref: "v1.18.2"
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Setup NDK
uses: nttld/setup-ndk@v1
with:
ndk-version: r21e
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0
- name: Generate script
run: dotnet run
working-directory: cb/bld
- name: Update permissions
run: chmod +x *.sh
working-directory: cb/bld
- name: Clean output directory
run: rm -fr bin
working-directory: cb/bld
- name: Build (Linux)
run: >
mv ./cb/.dockerignore . &&
docker buildx build
--output=type=local,dest=.
--cache-to type=gha
--cache-from type=gha
--build-arg TOOLCHAIN_RELEASE_BASE_URL=https://github.com/${{ github.repository }}/releases/download/crosscompilers
-f ./cb/Dockerfile
.
- name: Build (Android)
if: startsWith(matrix.os, 'ubuntu')
run: |
set -e
cd android_e_sqlite3
Expand All @@ -86,25 +126,9 @@ jobs:
mkdir -p ../bin/sqlite3mc/android
cp -r libs/* ../bin/sqlite3mc/android
working-directory: cb/bld
- name: Build (macOS, iOS, tvOS)
if: startsWith(matrix.os, 'macos')
run: |
set -e
for f in mac_*.sh maccatalyst_*.sh ios_*.sh tvos_*.sh; do
bash "$f"
done
working-directory: cb/bld
- name: Build (Windows)
if: startsWith(matrix.os, 'windows')
run: |
$files = Get-ChildItem *.bat -Exclude "win_e_sqlite3.bat","win_e_sqlite3mc.bat","win_e_sqlcipher.bat","win_sqlite3mc.bat"
foreach ($f in $files) {
cmd /C $f
}
working-directory: cb/bld
- uses: actions/upload-artifact@v4
with:
name: bin-${{ matrix.os }}
name: bin-linux
path: cb/bld/bin

build-wasm:
Expand All @@ -116,7 +140,7 @@ jobs:
- '{ "tfm": "net7.0", "emsdk": "3.1.12" }' # eol: 2024-05-14
- '{ "tfm": "net8.0", "emsdk": "3.1.34" }' # eol: 2026-11-14
- '{ "tfm": "net9.0", "emsdk": "3.1.56" }' # eol: 2026-05-12
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -157,7 +181,7 @@ jobs:
path: cb/bld/bin

test:
needs: [ build, build-wasm]
needs: [ build-linux, build-win-mac, build-wasm]
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
Expand All @@ -183,7 +207,7 @@ jobs:
working-directory: cb/bld
- uses: actions/download-artifact@v4
with:
name: bin-ubuntu-20.04
name: bin-linux
path: cb/bld/bin
- uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -235,9 +259,9 @@ jobs:
dotnet run

publish:
needs: [ build, build-wasm ]
needs: [ build-linux, build-win-mac, build-wasm ]
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -251,7 +275,7 @@ jobs:
working-directory: bld
- uses: actions/download-artifact@v4
with:
name: bin-ubuntu-20.04
name: bin-linux
path: bld/bin
- uses: actions/download-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bld/obj
68 changes: 68 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
FROM ubuntu:18.04 AS build

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

# Setup cross compilers
RUN dpkg --add-architecture i386 && \
apt-get -y update && \
apt-get install --allow-downgrades -y \
wget \
linux-libc-dev:i386 \
gcc-7-multilib \
gcc-arm-linux-gnueabi \
gcc-arm-linux-gnueabihf \
musl-dev musl-tools \
gcc-aarch64-linux-gnu \
gcc-mips64el-linux-gnuabi64 \
gcc-s390x-linux-gnu \
# gcc-powerpc64le-linux-gnu \
gcc-riscv64-linux-gnu

WORKDIR /a/crosscompilers

ARG TOOLCHAIN_RELEASE_BASE_URL

RUN wget -q ${TOOLCHAIN_RELEASE_BASE_URL}/arm-linux-musleabihf-cross.tgz && \
# wget https://musl.cc/arm-linux-musleabihf-cross.tgz
# wget https://ericsink.com/arm-linux-musleabihf-cross.tgz
tar --strip-components=1 -zxf ./arm-linux-musleabihf-cross.tgz && \
wget -q ${TOOLCHAIN_RELEASE_BASE_URL}/aarch64-linux-musl-cross.tgz && \
# wget https://musl.cc/aarch64-linux-musl-cross.tgz
# wget https://ericsink.com/aarch64-linux-musl-cross.tgz
tar --strip-components=1 -zxf aarch64-linux-musl-cross.tgz && \
wget -q ${TOOLCHAIN_RELEASE_BASE_URL}/s390x-linux-musl-cross.tgz && \
# wget https://musl.cc/s390x-linux-musl-cross.tgz
tar --strip-components=1 -zxf s390x-linux-musl-cross.tgz && \
wget -q ${TOOLCHAIN_RELEASE_BASE_URL}/riscv64-linux-musl-cross.tgz && \
# wget https://musl.cc/riscv64-linux-musl-cross.tgz
tar --strip-components=1 -zxf riscv64-linux-musl-cross.tgz && \
wget -q ${TOOLCHAIN_RELEASE_BASE_URL}/powerpc64le-power8--glibc--stable-2024.05-1.tar.xz && \
# wget https://toolchains.bootlin.com/downloads/releases/toolchains/powerpc64le-power8/tarballs/powerpc64le-power8--glibc--stable-2024.05-1.tar.xz
tar --strip-components=1 -xJf powerpc64le-power8--glibc--stable-2024.05-1.tar.xz

WORKDIR /a

COPY --link . .

WORKDIR /a/cb/bld

SHELL ["/bin/bash", "-c"]

# run build scripts
RUN export PATH="$PWD/../../crosscompilers/bin:$PATH" && \
set -e && \
for f in linux_*.sh; do \
if [[ "$f" == *_cross.sh ]] || [[ "$f" == *_regular.sh ]]; \
then \
continue; \
fi; \
bash "$f"; \
done

# pull end build products out into scratch image to simplify extraction
FROM scratch

COPY --from=build /a/cb/bld /cb/bld
2 changes: 1 addition & 1 deletion bld/cb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ IList<string> libs
break;

case "ppc64le":
compiler = "powerpc64le-linux-gnu-gcc";
compiler = "powerpc64le-linux-gcc";
break;

case "armhf":
Expand Down
29 changes: 0 additions & 29 deletions bld/setup_linux.sh

This file was deleted.