@@ -37,132 +37,132 @@ jobs:
3737 - os : linux
3838 runs-on : ubuntu-latest
3939 arch : x86_64
40- steps :
41- - name : Checkout code
42- uses : actions/checkout@v4
43-
44- - name : Set up Go
45- uses : actions/setup-go@v4
46- with :
47- go-version : " 1.21"
48-
49- - name : Install dependencies (Ubuntu)
50- if : matrix.os == 'linux'
51- run : |
52- sudo apt-get update
53- sudo apt-get install -y sqlite3 libsqlite3-dev build-essential
54-
55- - name : Install dependencies (macOS)
56- if : matrix.os == 'darwin'
57- run : |
58- brew install sqlite3
59-
60- - name : Install dependencies (Windows)
61- if : matrix.os == 'windows'
62- run : |
63- choco install sqlite
64-
65- - name : Build SQLite (Unix)
66- if : matrix.os != 'windows'
67- run : |
68- cd sqlite
69- if [ ! -d "sqlite-latest" ]; then
70- # Download and extract SQLite source if not present
71- curl -O https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz
72- tar xzf sqlite-autoconf-3450100.tar.gz
73- mv sqlite-autoconf-3450100 sqlite-latest
74- fi
75- cd sqlite-latest
76- ./configure --prefix=$(pwd)/../install --enable-static --disable-shared "CFLAGS=-DSQLITE_ENABLE_DBPAGE_VTAB=1 -O2"
77- make
78- make install
79-
80- - name : Build SQLite (Windows)
81- if : matrix.os == 'windows'
82- run : |
83- cd sqlite
84- if (!(Test-Path "sqlite-latest")) {
85- Invoke-WebRequest -Uri "https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz" -OutFile "sqlite-autoconf-3450100.tar.gz"
86- tar -xzf sqlite-autoconf-3450100.tar.gz
87- Rename-Item sqlite-autoconf-3450100 sqlite-latest
88- }
89- cd sqlite-latest
90- # Use MSYS2/MinGW for Windows build
91- bash -c "./configure --prefix=$(pwd)/../install --enable-static --disable-shared 'CFLAGS=-DSQLITE_ENABLE_DBPAGE_VTAB=1 -O2'"
92- bash -c "make"
93- bash -c "make install"
94-
95- - name : Build Bridge
96- run : |
97- cd bridge
98- make
99-
100- - name : Set build environment (Darwin ARM64)
101- if : matrix.os == 'darwin' && matrix.arch == 'arm64'
102- run : |
103- echo "GOOS=darwin" >> $GITHUB_ENV
104- echo "GOARCH=arm64" >> $GITHUB_ENV
105- echo "CGO_ENABLED=1" >> $GITHUB_ENV
106-
107- - name : Set build environment (Darwin AMD64)
108- if : matrix.os == 'darwin' && matrix.arch == 'amd64'
109- run : |
110- echo "GOOS=darwin" >> $GITHUB_ENV
111- echo "GOARCH=amd64" >> $GITHUB_ENV
112- echo "CGO_ENABLED=1" >> $GITHUB_ENV
113-
114- - name : Set build environment (Linux x86_64)
115- if : matrix.os == 'linux' && matrix.arch == 'x86_64'
116- run : |
117- echo "GOOS=linux" >> $GITHUB_ENV
118- echo "GOARCH=amd64" >> $GITHUB_ENV
119- echo "CGO_ENABLED=1" >> $GITHUB_ENV
120-
121- - name : Set build environment (Windows)
122- if : matrix.os == 'windows'
123- run : |
124- echo "GOOS=windows" >> $env:GITHUB_ENV
125- echo "GOARCH=amd64" >> $env:GITHUB_ENV
126- echo "CGO_ENABLED=1" >> $env:GITHUB_ENV
127-
128- - name : Build Client (Unix)
129- if : matrix.os != 'windows'
130- run : |
131- cd client
132- make build
133-
134- - name : Build Client (Windows)
135- if : matrix.os == 'windows'
136- run : |
137- cd client
138- # Use make with MSYS2/MinGW
139- bash -c "make build"
140-
141- - name : Create release directory
142- run : |
143- mkdir -p release
144-
145- - name : Package binary (Unix)
146- if : matrix.os != 'windows'
147- run : |
148- if [ "${{ matrix.os }}" = "darwin" ] && [ "${{ matrix.arch }}" = "arm64" ]; then
149- BINARY_NAME="sqlrsync-${{ matrix.os }}-${{ matrix.arch }}"
150- else
151- BINARY_NAME="sqlrsync-${{ matrix.os }}-${{ matrix.arch }}"
152- fi
153- cp client/bin/sqlrsync release/${BINARY_NAME}
154-
155- - name : Package binary (Windows)
156- if : matrix.os == 'windows'
157- run : |
158- $BINARY_NAME = "sqlrsync-${{ matrix.os }}-${{ matrix.arch }}.exe"
159- Copy-Item "client/bin/sqlrsync.exe" "release/$BINARY_NAME"
160-
161- - name : Upload artifacts
162- uses : actions/upload-artifact@v4
163- with :
164- name : sqlrsync-${{ matrix.os }}-${{ matrix.arch }}
165- path : release/*
40+ steps :
41+ - name : Checkout code
42+ uses : actions/checkout@v4
43+
44+ - name : Set up Go
45+ uses : actions/setup-go@v4
46+ with :
47+ go-version : " 1.21"
48+
49+ - name : Install dependencies (Ubuntu)
50+ if : matrix.os == 'linux'
51+ run : |
52+ sudo apt-get update
53+ sudo apt-get install -y sqlite3 libsqlite3-dev build-essential
54+
55+ - name : Install dependencies (macOS)
56+ if : matrix.os == 'darwin'
57+ run : |
58+ brew install sqlite3
59+
60+ - name : Install dependencies (Windows)
61+ if : matrix.os == 'windows'
62+ run : |
63+ choco install sqlite
64+
65+ - name : Build SQLite (Unix)
66+ if : matrix.os != 'windows'
67+ run : |
68+ cd sqlite
69+ if [ ! -d "sqlite-latest" ]; then
70+ # Download and extract SQLite source if not present
71+ curl -O https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz
72+ tar xzf sqlite-autoconf-3450100.tar.gz
73+ mv sqlite-autoconf-3450100 sqlite-latest
74+ fi
75+ cd sqlite-latest
76+ ./configure --prefix=$(pwd)/../install --enable-static --disable-shared "CFLAGS=-DSQLITE_ENABLE_DBPAGE_VTAB=1 -O2"
77+ make
78+ make install
79+
80+ - name : Build SQLite (Windows)
81+ if : matrix.os == 'windows'
82+ run : |
83+ cd sqlite
84+ if (!(Test-Path "sqlite-latest")) {
85+ Invoke-WebRequest -Uri "https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz" -OutFile "sqlite-autoconf-3450100.tar.gz"
86+ tar -xzf sqlite-autoconf-3450100.tar.gz
87+ Rename-Item sqlite-autoconf-3450100 sqlite-latest
88+ }
89+ cd sqlite-latest
90+ # Use MSYS2/MinGW for Windows build
91+ bash -c "./configure --prefix=$(pwd)/../install --enable-static --disable-shared 'CFLAGS=-DSQLITE_ENABLE_DBPAGE_VTAB=1 -O2'"
92+ bash -c "make"
93+ bash -c "make install"
94+
95+ - name : Build Bridge
96+ run : |
97+ cd bridge
98+ make
99+
100+ - name : Set build environment (Darwin ARM64)
101+ if : matrix.os == 'darwin' && matrix.arch == 'arm64'
102+ run : |
103+ echo "GOOS=darwin" >> $GITHUB_ENV
104+ echo "GOARCH=arm64" >> $GITHUB_ENV
105+ echo "CGO_ENABLED=1" >> $GITHUB_ENV
106+
107+ - name : Set build environment (Darwin AMD64)
108+ if : matrix.os == 'darwin' && matrix.arch == 'amd64'
109+ run : |
110+ echo "GOOS=darwin" >> $GITHUB_ENV
111+ echo "GOARCH=amd64" >> $GITHUB_ENV
112+ echo "CGO_ENABLED=1" >> $GITHUB_ENV
113+
114+ - name : Set build environment (Linux x86_64)
115+ if : matrix.os == 'linux' && matrix.arch == 'x86_64'
116+ run : |
117+ echo "GOOS=linux" >> $GITHUB_ENV
118+ echo "GOARCH=amd64" >> $GITHUB_ENV
119+ echo "CGO_ENABLED=1" >> $GITHUB_ENV
120+
121+ - name : Set build environment (Windows)
122+ if : matrix.os == 'windows'
123+ run : |
124+ echo "GOOS=windows" >> $env:GITHUB_ENV
125+ echo "GOARCH=amd64" >> $env:GITHUB_ENV
126+ echo "CGO_ENABLED=1" >> $env:GITHUB_ENV
127+
128+ - name : Build Client (Unix)
129+ if : matrix.os != 'windows'
130+ run : |
131+ cd client
132+ make build
133+
134+ - name : Build Client (Windows)
135+ if : matrix.os == 'windows'
136+ run : |
137+ cd client
138+ # Use make with MSYS2/MinGW
139+ bash -c "make build"
140+
141+ - name : Create release directory
142+ run : |
143+ mkdir -p release
144+
145+ - name : Package binary (Unix)
146+ if : matrix.os != 'windows'
147+ run : |
148+ if [ "${{ matrix.os }}" = "darwin" ] && [ "${{ matrix.arch }}" = "arm64" ]; then
149+ BINARY_NAME="sqlrsync-${{ matrix.os }}-${{ matrix.arch }}"
150+ else
151+ BINARY_NAME="sqlrsync-${{ matrix.os }}-${{ matrix.arch }}"
152+ fi
153+ cp client/bin/sqlrsync release/${BINARY_NAME}
154+
155+ - name : Package binary (Windows)
156+ if : matrix.os == 'windows'
157+ run : |
158+ $BINARY_NAME = "sqlrsync-${{ matrix.os }}-${{ matrix.arch }}.exe"
159+ Copy-Item "client/bin/sqlrsync.exe" "release/$BINARY_NAME"
160+
161+ - name : Upload artifacts
162+ uses : actions/upload-artifact@v4
163+ with :
164+ name : sqlrsync-${{ matrix.os }}-${{ matrix.arch }}
165+ path : release/*
166166
167167 release :
168168 if : github.ref == 'refs/heads/main' && github.event_name == 'push'
0 commit comments