-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 314b262
Showing
11 changed files
with
4,978 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Build - Windows | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [windows-2022] | ||
arch: ["Win32", "Win64"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup MSVC | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch == 'Win32' && 'amd64_x86' || matrix.arch == 'Win64' && 'amd64'}} | ||
|
||
- name: Clear SQLite and temp files | ||
continue-on-error: true | ||
run: | | ||
mkdir -p C:\temp\${{ matrix.arch }}\ | ||
mkdir -p C:\dev | ||
- name: Install SQLite | ||
run: | | ||
$htmlContent = Invoke-WebRequest -Uri "https://sqlite.org/download.html" | Select-Object -ExpandProperty Content | ||
$regex = [regex]::new('PRODUCT,(\d+\.\d+\.\d+),(\d+/sqlite-amalgamation-\d+\.zip),\d+,(.+)') | ||
$match = $regex.Match($htmlContent) | ||
$relativeUrl = $match.Groups[2].Value | ||
$downloadLink = "https://sqlite.org/$relativeUrl" | ||
Invoke-WebRequest -Uri $downloadLink -OutFile 'C:\temp\${{ matrix.arch }}\sqlite.zip' | ||
Expand-Archive -Path C:\temp\${{ matrix.arch }}\sqlite.zip -DestinationPath C:\temp\${{ matrix.arch }} | ||
Move-Item -Path C:\temp\${{ matrix.arch }}\sqlite-amalgamation-* C:\dev\SQLite-${{ matrix.arch }} | ||
cd C:\dev\SQLite-${{ matrix.arch }} | ||
cl sqlite3.c -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_MAX_ATTACHED=125 -DSQLITE_API="__declspec(dllexport)" -link -dll -out:sqlite3.dll | ||
- name: Install SQLite Extensions | ||
run: | | ||
cp .\src\extensions\extension-formats.c C:\dev\SQLite-${{ matrix.arch}}\ | ||
cp .\src\extensions\extension-formats.def C:\dev\SQLite-${{ matrix.arch}}\ | ||
cp .\src\extensions\extension-functions.c C:\dev\SQLite-${{ matrix.arch}}\ | ||
cp .\src\extensions\extension-functions.def C:\dev\SQLite-${{ matrix.arch}}\ | ||
cd C:\dev\SQLite-${{ matrix.arch}}\ | ||
cl /MD extension-formats.c -link -dll -def:extension-formats.def -out:formats.dll | ||
cl /MD extension-functions.c -link -dll -def:extension-functions.def -out:math.dll | ||
# FIXME: Disable building the 'fileio' extension for now (#3488) | ||
# If this issue is resolved, be sure to delete the related patch for WiX | ||
# curl -L -o fileio.c "https://sqlite.org/src/raw?filename=ext/misc/fileio.c&ci=trunk" | ||
# curl -L -o test_windirent.c "https://sqlite.org/src/raw?filename=src/test_windirent.c&ci=trunk" | ||
# curl -L -o test_windirent.h "https://sqlite.org/src/raw?filename=src/test_windirent.h&ci=trunk" | ||
# cl /MD fileio.c test_windirent.c -link sqlite3.lib -dll -out:fileio.dll | ||
- name: Install SQLCipher | ||
# ref: https://github.com/actions/runner-images/blob/main/images/windows/scripts/build/Install-OpenSSL.ps1#L12 | ||
run: | | ||
mkdir -p C:\dev\SQLCipher-${{ matrix.arch }} | ||
cd C:\dev\SQLCipher-${{ matrix.arch }} | ||
git clone https://github.com/sqlcipher/sqlcipher.git . | ||
git reset --hard $(git describe --tags --abbrev=0) | ||
nmake /f Makefile.msc sqlcipher.dll USE_AMALGAMATION=1 NO_TCL=1 SQLITE3DLL=sqlcipher.dll SQLITE3LIB=sqlcipher.lib SQLITE3EXE=sqlcipher.exe LTLINKOPTS="$env:ProgramFiles\OpenSSL\lib\libcrypto.lib" OPT_FEATURE_FLAGS="-DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC=1 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_STAT4=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_JSON1=1 -DSQLITE_ENABLE_GEOPOLY=1 -DSQLITE_ENABLE_RTREE=1 -DSQLCIPHER_CRYPTO_OPENSSL=1 -DSQLITE_MAX_ATTACHED=125 -I$env:ProgramFiles\OpenSSL\include" | ||
mkdir sqlcipher | ||
copy sqlite3.h sqlcipher | ||
- name: Prepare artifacts | ||
run: | | ||
cd C:\ | ||
Compress-Archive -Path C:\dev\* -DestinationPath build-artifacts-${{ matrix.arch }}.zip | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-artifacts-${{ matrix.os }}-${{ matrix.arch }} | ||
path: build-artifacts-${{ matrix.arch }}.zip | ||
retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Makefile | ||
sqlitebrowser.pro.user | ||
.qmake.stash | ||
CMakeLists.txt.user | ||
CMakeFiles | ||
*.cmake | ||
*.cxx_parameters | ||
|
||
# ignore any build folders | ||
build*/ | ||
# folder with temporary test data | ||
testdata/ | ||
|
||
src/.ui/ | ||
src/sqlitebrowser | ||
src/Makefile* | ||
src/debug | ||
src/release | ||
|
||
# ignore compiled translation files | ||
src/translations/*.qm | ||
|
||
# ignore compiled macOS app | ||
src/*.app/ | ||
|
||
# no one needs the txt file | ||
src/grammar/sqlite3TokenTypes.txt | ||
|
||
libs/*/Makefile* | ||
libs/*/*/Makefile* | ||
libs/*/debug/ | ||
libs/*/*/debug/ | ||
libs/*/release/ | ||
libs/*/*/release/ | ||
libs/*/*.a | ||
libs/*/*/*.a | ||
|
||
# Ignore .DS_Store files on OSX | ||
.DS_Store |
Oops, something went wrong.