-
Notifications
You must be signed in to change notification settings - Fork 0
377 lines (311 loc) · 12.7 KB
/
release.yml
File metadata and controls
377 lines (311 loc) · 12.7 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# BLite Server — Release Pipeline
# Copyright (C) 2026 Luca Fabbri — AGPL-3.0
#
# Triggered by version tags (v*.*.*).
# Produces:
# • Docker image pushed to ghcr.io/entgldb/blite-server
# • Docker image pushed to docker.io/mrdevrobotentgldb/blite-server
# • NuGet package BLite.Client published to nuget.org
# • Windows installer (.exe) built with Inno Setup 6
# • Linux tarball (.tar.gz) with self-contained binary + install.sh
# • GitHub Release with all artifacts attached
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write # create GitHub Release + upload assets
packages: write # push to ghcr.io
jobs:
# ── NuGet packages ──────────────────────────────────────────────────────────
nuget-client:
name: Pack & Publish BLite.Client + BLite.Proto
runs-on: ubuntu-latest
steps:
- name: Checkout BLite.Server
uses: actions/checkout@v4
with:
path: BLite.Server
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Pack BLite.Proto
run: >
dotnet pack BLite.Server/src/BLite.Proto/BLite.Proto.csproj
--configuration Release
--output artifacts/nuget
-p:Version=${{ steps.version.outputs.version }}
--nologo
- name: Pack BLite.Client
run: >
dotnet pack BLite.Server/src/BLite.Client/BLite.Client.csproj
--configuration Release
--output artifacts/nuget
-p:Version=${{ steps.version.outputs.version }}
--nologo
- name: Publish BLite.Proto to NuGet.org
run: >
dotnet nuget push "artifacts/nuget/BLite.Proto.${{ steps.version.outputs.version }}.nupkg"
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY }}
--skip-duplicate
- name: Publish BLite.Client to NuGet.org
run: >
dotnet nuget push "artifacts/nuget/BLite.Client.${{ steps.version.outputs.version }}.nupkg"
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY }}
--skip-duplicate
# ── Docker image ─────────────────────────────────────────────────────────────
docker:
name: Build & Push Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout BLite.Server
uses: actions/checkout@v4
with:
path: BLite.Server
- name: Checkout BLite engine (sibling repo)
uses: actions/checkout@v4
with:
repository: EntglDb/BLite
path: BLite
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
# Build context is the workspace root so that both BLite.Server/ and
# BLite/ are visible to the Dockerfile COPY instructions.
context: ${{ github.workspace }}
file: BLite.Server/Dockerfile
push: true
platforms: linux/amd64
tags: |
ghcr.io/entgldb/blite-server:${{ steps.version.outputs.version }}
ghcr.io/entgldb/blite-server:latest
mrdevrobotentgldb/blite-server:${{ steps.version.outputs.version }}
mrdevrobotentgldb/blite-server:latest
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VERSION=${{ steps.version.outputs.version }}
# ── Windows installer ─────────────────────────────────────────────────────────
windows-installer:
name: Build Windows Installer
runs-on: windows-latest
steps:
- name: Checkout BLite.Server
uses: actions/checkout@v4
with:
path: BLite.Server
- name: Checkout BLite engine (sibling repo)
uses: actions/checkout@v4
with:
repository: EntglDb/BLite
path: BLite
- name: Extract version
id: version
shell: bash
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Publish self-contained win-x64
run: >
dotnet publish BLite.Server/src/BLite.Server/BLite.Server.csproj
--configuration Release
--runtime win-x64
--self-contained true
--output artifacts/win-x64
-p:Version=${{ steps.version.outputs.version }}
- name: Install Inno Setup 6
run: choco install innosetup --no-progress --yes
- name: Build Windows installer
shell: cmd
run: >
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe"
/DSourceDir="%GITHUB_WORKSPACE%\artifacts\win-x64"
/DAppVersion="${{ steps.version.outputs.version }}"
"%GITHUB_WORKSPACE%\BLite.Server\deploy\windows\blite-server.iss"
- name: Upload Windows installer artifact
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: BLite.Server/deploy/windows/Output/*.exe
if-no-files-found: error
# ── Linux installer ───────────────────────────────────────────────────────────
linux-installer:
name: Build Linux Installer
runs-on: ubuntu-latest
steps:
- name: Checkout BLite.Server
uses: actions/checkout@v4
with:
path: BLite.Server
- name: Checkout BLite engine (sibling repo)
uses: actions/checkout@v4
with:
repository: EntglDb/BLite
path: BLite
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Publish self-contained linux-x64
run: >
dotnet publish BLite.Server/src/BLite.Server/BLite.Server.csproj
--configuration Release
--runtime linux-x64
--self-contained true
--output artifacts/linux-x64
-p:Version=${{ steps.version.outputs.version }}
- name: Assemble tarball
run: |
BUNDLE_DIR="blite-server-${{ steps.version.outputs.version }}-linux-x64"
mkdir -p "$BUNDLE_DIR/bin"
# Published binary + all runtime files
cp -r artifacts/linux-x64/. "$BUNDLE_DIR/bin/"
# Installer script and systemd unit
cp BLite.Server/deploy/linux/install.sh "$BUNDLE_DIR/"
cp BLite.Server/deploy/linux/blite-server.service "$BUNDLE_DIR/"
chmod +x "$BUNDLE_DIR/install.sh"
chmod +x "$BUNDLE_DIR/bin/BLite.Server"
tar -czf "${BUNDLE_DIR}.tar.gz" "$BUNDLE_DIR"
- name: Upload Linux installer artifact
uses: actions/upload-artifact@v4
with:
name: linux-installer
path: "blite-server-${{ steps.version.outputs.version }}-linux-x64.tar.gz"
if-no-files-found: error
# ── npm package (TypeScript client) ─────────────────────────────────────────
npm-client:
name: Pack & Publish blite-client (npm)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
working-directory: src/BLite.Client.TypeScript
run: npm install
- name: Set version
working-directory: src/BLite.Client.TypeScript
run: npm pkg set version=${{ steps.version.outputs.version }}
- name: Build
working-directory: src/BLite.Client.TypeScript
run: npm run build
- name: Publish to npm
working-directory: src/BLite.Client.TypeScript
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# ── Maven Central (Java client) ──────────────────────────────────────────────
maven-central-client:
name: Publish BLite.Client.Java to Maven Central
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Setup Java 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Decode GPG signing key
run: |
{
echo 'ORG_GRADLE_PROJECT_signingInMemoryKey<<EOF'
echo "${{ secrets.GPG_SIGNING_KEY }}" | base64 --decode
echo 'EOF'
} >> "$GITHUB_ENV"
- name: Publish to Maven Central
working-directory: src/BLite.Client.Java
run: gradle publish -Pversion=${{ steps.version.outputs.version }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
# signingInMemoryKey is injected from the decode step via $GITHUB_ENV
# ── GitHub Release ────────────────────────────────────────────────────────────
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: [nuget-client, npm-client, maven-central-client, docker, windows-installer, linux-installer]
steps:
- name: Download Windows installer
uses: actions/download-artifact@v4
with:
name: windows-installer
path: release-assets/
- name: Download Linux installer
uses: actions/download-artifact@v4
with:
name: linux-installer
path: release-assets/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: release-assets/*
generate_release_notes: true
body: |
## Docker
```bash
docker pull ghcr.io/entgldb/blite-server:${{ github.ref_name }}
# or
docker pull mrdevrobotentgldb/blite-server:${{ github.ref_name }}
docker run -d \
-e Auth__RootKey=<your-secret-key> \
-p 2626:2626 \
-p 2627:2627 \
-v blite-data:/data \
ghcr.io/entgldb/blite-server:${{ github.ref_name }}
```
## Windows
Run the `.exe` installer as Administrator. The wizard will ask for ports,
a root API key, and the source URL (required for AGPLv3 §13 compliance).
BLite Server is registered as a Windows Service and starts automatically.
## Linux
```bash
tar -xzf blite-server-*-linux-x64.tar.gz
cd blite-server-*-linux-x64
sudo ./install.sh
```
The installer creates a `blite` system user, installs the binary to
`/opt/blite-server`, and registers a systemd service.
> **AGPLv3 notice** — source code is available at
> https://github.com/EntglDb/BLite.Server