Skip to content

Commit 8b3eb4d

Browse files
committed
updated ci
1 parent f649d28 commit 8b3eb4d

File tree

3 files changed

+97
-65
lines changed

3 files changed

+97
-65
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,13 @@ jobs:
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
20-
os: [ubuntu-20.04, windows-latest, macos-latest]
20+
include:
21+
- os: ubuntu-20.04
22+
- os: windows-latest
23+
- os: macos-latest
24+
arch: amd64
25+
- os: macos-latest
26+
arch: arm64
2127

2228
steps:
2329
- uses: actions/checkout@v4
@@ -70,8 +76,14 @@ jobs:
7076
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
7177
Write-Host "split_part tests completed successfully."
7278
73-
- name: Compile and test on macOS
74-
if: matrix.os == 'macos-latest'
79+
- name: Compile and test on macOS (AMD64)
80+
if: matrix.os == 'macos-latest' && matrix.arch == 'amd64'
81+
run: |
82+
make compile-macos-x86
83+
make test-all
84+
85+
- name: Compile and test on macOS (ARM64)
86+
if: matrix.os == 'macos-latest' && matrix.arch == 'arm64'
7587
run: |
76-
make compile-macos
88+
make compile-macos-arm64
7789
make test-all

.github/workflows/publish.yml

Lines changed: 72 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,84 @@
11
name: publish
22

33
on:
4-
push:
5-
tags:
6-
- "*"
7-
workflow_dispatch:
8-
9-
env:
10-
SQLITE_RELEASE_YEAR: "2021"
11-
SQLITE_VERSION: "3360000"
12-
SQLITE_BRANCH: "3.36"
4+
push:
5+
tags:
6+
- "*" # Trigger on any tag push
7+
workflow_dispatch:
138

149
jobs:
15-
publish:
16-
name: Publish for ${{ matrix.os }}
17-
runs-on: ${{ matrix.os }}
18-
strategy:
19-
matrix:
20-
include:
21-
- os: ubuntu-20.04
22-
- os: windows-latest
23-
- os: macos-latest
10+
publish:
11+
name: Publish for ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-20.04, windows-latest, macos-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Extract version from tag
21+
id: extract_version
22+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
23+
24+
- name: Install dependencies on Linux
25+
if: matrix.os == 'ubuntu-20.04'
26+
run: sudo apt-get install -y sqlite3 gcc unzip gcc-aarch64-linux-gnu
27+
28+
- name: Install dependencies on Windows
29+
if: matrix.os == 'windows-latest'
30+
shell: pwsh
31+
run: |
32+
choco install -y mingw
33+
choco install -y unzip
34+
choco install -y sqlite
2435
25-
steps:
26-
- uses: actions/checkout@v2
36+
- name: Install dependencies on macOS
37+
if: matrix.os == 'macos-latest'
38+
run: |
39+
brew install unzip
40+
brew install sqlite
41+
brew link sqlite --force
2742
28-
- name: Download SQLite sources
29-
shell: bash
30-
run: |
31-
make prepare-dist
32-
make download-sqlite
33-
make download-external
43+
- name: Download and prepare sources
44+
run: |
45+
make prepare-dist
46+
make download-sqlite
3447
35-
- name: Build for Linux
36-
if: matrix.os == 'ubuntu-20.04'
37-
run: |
38-
sudo apt update
39-
sudo apt install -y gcc-aarch64-linux-gnu
40-
make compile-linux-x86
41-
make compile-linux-arm64
42-
make pack-linux
48+
- name: Build for Linux
49+
if: matrix.os == 'ubuntu-20.04'
50+
run: |
51+
make compile-linux-x86
52+
make compile-linux-arm64
53+
make pack-linux version=${{ env.VERSION }}
4354
44-
- name: Install MSYS2 and 'mingw-w64-i686-toolchain'
45-
if: matrix.os == 'windows-latest'
46-
uses: msys2/setup-msys2@v2
47-
with:
48-
cache: true
49-
install: mingw-w64-i686-toolchain
50-
update: true
55+
- name: Install MSYS2 and 'mingw-w64-i686-toolchain'
56+
if: matrix.os == 'windows-latest'
57+
uses: msys2/setup-msys2@v2
58+
with:
59+
update: true
60+
install: mingw-w64-i686-toolchain
61+
msystem: MINGW32
5162

52-
- name: Build for Windows
53-
if: matrix.os == 'windows-latest'
54-
shell: bash
55-
run: |
56-
$RUNNER_TEMP/msys64/msys2_shell.cmd -defterm -no-start -mingw32 -lc "mingw32-make compile-windows-x86"
57-
make compile-windows
58-
make pack-windows
63+
- name: Build for Windows
64+
if: matrix.os == 'windows-latest'
65+
shell: msys2 {0}
66+
run: |
67+
make compile-windows-x86
68+
make compile-windows
69+
make pack-windows version=${{ env.VERSION }}
5970
60-
- name: Build for macOS
61-
if: matrix.os == 'macos-latest'
62-
run: |
63-
make compile-macos-x86
64-
make compile-macos-arm64
65-
make pack-macos
71+
- name: Build for macOS
72+
if: matrix.os == 'macos-latest'
73+
run: |
74+
make compile-macos-x86
75+
make compile-macos-arm64
76+
make pack-macos version=${{ env.VERSION }}
6677
67-
- name: Upload binaries to release
68-
uses: svenstaro/upload-release-action@v2
69-
with:
70-
repo_token: ${{ secrets.GITHUB_TOKEN }}
71-
file: dist/*.zip
72-
file_glob: true
73-
tag: ${{ github.ref }}
78+
- name: Upload binaries to release
79+
uses: svenstaro/upload-release-action@v2
80+
with:
81+
repo_token: ${{ secrets.GITHUB_TOKEN }}
82+
file: dist/*.zip
83+
file_glob: true
84+
tag: ${{ github.ref_name }}

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ compile-macos:
3535
gcc -O2 -fPIC -dynamiclib -Isrc src/regexp/*.c -o dist/regexp.dylib
3636
gcc -O2 -fPIC -dynamiclib -Isrc src/split_part/*.c -o dist/split_part.dylib
3737

38+
pack-linux:
39+
zip -j dist/stackql-sqlite-ext-functions-$(version)-linux-amd64.zip dist/*.so
40+
41+
pack-windows:
42+
zip -j dist/stackql-sqlite-ext-functions-$(version)-windows-amd64.zip dist/*.dll
43+
44+
pack-macos:
45+
zip -j dist/stackql-sqlite-ext-functions-$(version)-macos-amd64.zip dist/*.dylib
46+
3847
test-all:
3948
@echo "Running tests on all suites"
4049
@make test suite=json_equal

0 commit comments

Comments
 (0)