Skip to content

Commit af9a7bb

Browse files
psarnapenberg
authored andcommitted
Add scripts for creating release artifacts
The scripts are meant to be run during releases in order to automate producing artifacts, like precompiled binaries and the amalgamation files.
1 parent fd2aae3 commit af9a7bb

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

Makefile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,7 @@ clean:
15381538
rm -f dbhash dbhash.exe
15391539
rm -f fts5.* fts5parse.*
15401540
rm -f threadtest5
1541+
rm -f libsql*.tar.gz
15411542

15421543
distclean: clean
15431544
rm -f sqlite_cfg.h config.log config.status libtool Makefile sqlite3.pc sqlite3session.h \

tool/generate-artifacts.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
# Generates artifacts from the current build:
4+
# - .c and .h amalgamation files
5+
# - a precompiled binary package
6+
#
7+
# Assumes that ./configure and make steps were executed and succeeded
8+
9+
LIBSQL_WASM_UDF_SUFFIX=
10+
if grep -s "TARGET_OPT_WASM_RUNTIME_LINK.*libwblibsql\.a" Makefile; then
11+
LIBSQL_WASM_UDF_SUFFIX="-wasm-udf"
12+
elif grep -s "TARGET_OPT_WASM_RUNTIME_LINK.*lwblibsql" Makefile; then
13+
LIBSQL_WASM_UDF_SUFFIX="-wasm-udf-dynamic"
14+
fi
15+
16+
set -x
17+
18+
tar czvf libsql-amalgamation-$(<LIBSQL_VERSION)${LIBSQL_WASM_UDF_SUFFIX}.tar.gz sqlite3.c sqlite3.h
19+
tar czvf libsql-$(<LIBSQL_VERSION)${LIBSQL_WASM_UDF_SUFFIX}.tar.gz sqlite3 libsql .libs

tool/pre-release.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
# Compiles libSQL in the following flavors:
4+
# - vanilla
5+
# - with Wasm user-defined functions support linked statically
6+
# - with Wasm user-defined functions support linked as a separate dynamic library
7+
8+
if [[ "$#" != "1" ]]; then
9+
echo "Usage: $0 <release-number>"
10+
fi
11+
12+
for mode in "" "--enable-wasm-runtime" "--enable-wasm-runtime-dynamic"; do
13+
echo Mode: ${mode:-regular}
14+
./configure --enable-releasemode --enable-all $mode && make -j12 && ./tool/generate-artifacts.sh
15+
done

0 commit comments

Comments
 (0)