-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (187 loc) · 6.91 KB
/
Copy pathci.yml
File metadata and controls
193 lines (187 loc) · 6.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: CI
on:
push:
branches: ["**"]
tags: ["v*"]
pull_request:
branches: ["**"]
jobs:
# ----------------------------------------------------------------------------
# Plain build + tests on every push and PR.
# ----------------------------------------------------------------------------
build-test:
name: build & test (debian 13)
runs-on: ubuntu-latest
container: debian:13
steps:
- name: install deps
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential cmake pkg-config git ca-certificates \
libsqlite3-dev libsodium-dev libmbedtls-dev libasio-dev \
nodejs npm python3
- uses: actions/checkout@v4
- name: build web bundle
working-directory: web
run: |
npm ci
npm run build
bash embed.sh
- run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- run: cmake --build build -j
- run: ctest --test-dir build --output-on-failure
- working-directory: web
run: node --test tests/
# ----------------------------------------------------------------------------
# Server .deb packages (one per Debian release). Built via cpack -G DEB
# inside the matching distro container so dependency soname pinning matches
# the distro's libsodium / libmbedtls / libsqlite3 of that release.
# CLI is excluded from the .deb (BUILD_CLI=OFF) — distributed separately as
# a musl-static binary by `release-linux-cli`.
# ----------------------------------------------------------------------------
release-linux-deb:
name: release server .deb (debian ${{ matrix.debian }})
if: startsWith(github.ref, 'refs/tags/v')
needs: build-test
runs-on: ubuntu-latest
container: debian:${{ matrix.debian }}
strategy:
fail-fast: false
matrix:
debian: ["12", "13"]
env:
APP_VERSION: ${{ github.ref_name }}
steps:
- name: install deps
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential cmake pkg-config git ca-certificates \
dpkg-dev file \
libsqlite3-dev libsodium-dev libmbedtls-dev libasio-dev \
nodejs npm python3
- uses: actions/checkout@v4
- name: build web bundle
working-directory: web
env:
APP_VERSION: ${{ github.ref_name }}
run: |
npm ci
npm run build
bash embed.sh
- name: configure & build (server only)
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SERVER=ON -DBUILD_CLI=OFF
cmake --build build -j
- name: cpack -> .deb
working-directory: build
run: |
cpack -G DEB
# Tag the file with the distro release for clarity in the GH release.
for f in *.deb; do
mv "$f" "${f%.deb}-debian${{ matrix.debian }}.deb"
done
ls -la *.deb
- uses: actions/upload-artifact@v4
with:
name: server-deb-debian${{ matrix.debian }}
path: build/*-debian${{ matrix.debian }}.deb
# ----------------------------------------------------------------------------
# Standalone musl-static `blin` for Linux. Built in Alpine so the result is
# a single self-contained binary that runs on any glibc/musl distro.
# ----------------------------------------------------------------------------
release-linux-cli:
name: release blin (linux musl static)
if: startsWith(github.ref, 'refs/tags/v')
needs: build-test
runs-on: ubuntu-latest
container: alpine:latest
env:
APP_VERSION: ${{ github.ref_name }}
steps:
- name: install deps
run: |
apk add --no-cache \
build-base cmake pkgconfig git linux-headers \
libsodium-dev libsodium-static \
mbedtls-dev mbedtls-static
- uses: actions/checkout@v4
- name: configure & build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SERVER=OFF -DBUILD_CLI=ON -DBLIN_STATIC=ON
cmake --build build -j
file build/cli/blin || true
ldd build/cli/blin || true
- name: stage release
run: |
# Pack the binary at archive top level — no nested directory —
# so `tar xf blin-cli-linux-x86_64-static.tar.gz` yields `blin` directly.
tar czf blin-cli-linux-x86_64-static.tar.gz -C build/cli blin
- uses: actions/upload-artifact@v4
with:
name: blin-cli-linux-static
path: blin-cli-linux-x86_64-static.tar.gz
# ----------------------------------------------------------------------------
# Windows CLI build via vcpkg. Server is not built on Windows — only blin.exe.
# ----------------------------------------------------------------------------
release-windows:
name: release blin (windows)
if: startsWith(github.ref, 'refs/tags/v')
needs: build-test
runs-on: windows-latest
env:
APP_VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: vcpkg deps
run: |
vcpkg install libsodium:x64-windows-static-md mbedtls:x64-windows-static-md
shell: pwsh
- name: configure
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release `
-DBUILD_SERVER=OFF -DBUILD_CLI=ON `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md
shell: pwsh
- name: build
run: cmake --build build --config Release -j
- name: stage release
run: |
# Pack the binary at archive top level — no nested directory —
# so unzipping yields `blin.exe` directly.
Compress-Archive -Path build\cli\Release\blin.exe `
-DestinationPath blin-cli-windows-x86_64.zip
shell: pwsh
- uses: actions/upload-artifact@v4
with:
name: blin-cli-windows
path: blin-cli-windows-x86_64.zip
# ----------------------------------------------------------------------------
# Gather all artifacts and attach them to the GitHub Release for the tag.
# ----------------------------------------------------------------------------
publish-release:
name: publish github release
if: startsWith(github.ref, 'refs/tags/v')
needs: [release-linux-deb, release-linux-cli, release-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- name: flatten
run: |
mkdir -p out
find dist -type f \
\( -name '*.deb' -o -name '*.tar.gz' -o -name '*.zip' \) \
-exec cp {} out/ \;
ls -la out
- uses: softprops/action-gh-release@v2
with:
files: out/*
generate_release_notes: true