Skip to content

Commit 6945bc3

Browse files
authored
Merge branch 'main' into hotfix/embedding
2 parents 9010923 + bbe31f2 commit 6945bc3

13 files changed

Lines changed: 561 additions & 37 deletions

File tree

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,11 @@ SCORE_LOW_INTEREST_THRESHOLD=40.0
127127

128128
# Score cache TTL in seconds
129129
SCORE_CACHE_TTL=3600
130+
131+
# ========================================
132+
# Docker Image Version (for testing pre-releases)
133+
# ========================================
134+
# Docker image tag to use (default: latest)
135+
# For stable releases, use: latest (default)
136+
# For testing pre-releases, use specific version tag like: v0.3.0-alpha.1, v0.3.0-beta.1, v0.3.0-rc.1
137+
# IMAGE_TAG=latest

.github/workflows/pre-release.yml

Lines changed: 329 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,329 @@
1+
name: Pre-Release (Alpha/Beta)
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*-alpha.*'
7+
- 'v*-beta.*'
8+
- 'v*-rc.*'
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_PREFIX: ${{ github.repository_owner }}/glean
13+
14+
jobs:
15+
build-backend:
16+
name: Build Backend Image (Pre-release)
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v6
25+
26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v3
28+
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
32+
- name: Log in to Container Registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Extract metadata
40+
id: meta
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-backend
44+
tags: |
45+
type=semver,pattern={{version}}
46+
type=semver,pattern={{major}}.{{minor}}-{{prerelease}}
47+
48+
- name: Extract version from tag
49+
id: version
50+
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
51+
52+
- name: Build and push Backend image
53+
uses: docker/build-push-action@v6
54+
with:
55+
context: ./backend
56+
file: ./backend/Dockerfile
57+
platforms: linux/amd64,linux/arm64
58+
push: true
59+
tags: ${{ steps.meta.outputs.tags }}
60+
labels: ${{ steps.meta.outputs.labels }}
61+
build-args: |
62+
APP_VERSION=${{ steps.version.outputs.version }}
63+
cache-from: type=gha
64+
cache-to: type=gha,mode=max
65+
66+
build-web:
67+
name: Build Web Frontend Image (Pre-release)
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: read
71+
packages: write
72+
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@v6
76+
77+
- name: Set up QEMU
78+
uses: docker/setup-qemu-action@v3
79+
80+
- name: Set up Docker Buildx
81+
uses: docker/setup-buildx-action@v3
82+
83+
- name: Log in to Container Registry
84+
uses: docker/login-action@v3
85+
with:
86+
registry: ${{ env.REGISTRY }}
87+
username: ${{ github.actor }}
88+
password: ${{ secrets.GITHUB_TOKEN }}
89+
90+
- name: Extract metadata
91+
id: meta
92+
uses: docker/metadata-action@v5
93+
with:
94+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-web
95+
tags: |
96+
type=semver,pattern={{version}}
97+
type=semver,pattern={{major}}.{{minor}}-{{prerelease}}
98+
99+
- name: Build and push Web image
100+
uses: docker/build-push-action@v6
101+
with:
102+
context: ./frontend
103+
file: ./frontend/apps/web/Dockerfile
104+
platforms: linux/amd64,linux/arm64
105+
push: true
106+
tags: ${{ steps.meta.outputs.tags }}
107+
labels: ${{ steps.meta.outputs.labels }}
108+
cache-from: type=gha
109+
cache-to: type=gha,mode=max
110+
111+
build-admin:
112+
name: Build Admin Dashboard Image (Pre-release)
113+
runs-on: ubuntu-latest
114+
permissions:
115+
contents: read
116+
packages: write
117+
118+
steps:
119+
- name: Checkout repository
120+
uses: actions/checkout@v6
121+
122+
- name: Set up QEMU
123+
uses: docker/setup-qemu-action@v3
124+
125+
- name: Set up Docker Buildx
126+
uses: docker/setup-buildx-action@v3
127+
128+
- name: Log in to Container Registry
129+
uses: docker/login-action@v3
130+
with:
131+
registry: ${{ env.REGISTRY }}
132+
username: ${{ github.actor }}
133+
password: ${{ secrets.GITHUB_TOKEN }}
134+
135+
- name: Extract metadata
136+
id: meta
137+
uses: docker/metadata-action@v5
138+
with:
139+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-admin
140+
tags: |
141+
type=semver,pattern={{version}}
142+
type=semver,pattern={{major}}.{{minor}}-{{prerelease}}
143+
144+
- name: Build and push Admin image
145+
uses: docker/build-push-action@v6
146+
with:
147+
context: ./frontend
148+
file: ./frontend/apps/admin/Dockerfile
149+
platforms: linux/amd64,linux/arm64
150+
push: true
151+
tags: ${{ steps.meta.outputs.tags }}
152+
labels: ${{ steps.meta.outputs.labels }}
153+
cache-from: type=gha
154+
cache-to: type=gha,mode=max
155+
156+
build-electron:
157+
name: Build Electron App (${{ matrix.os }}) - Pre-release
158+
runs-on: ${{ matrix.os }}
159+
permissions:
160+
contents: write
161+
strategy:
162+
fail-fast: false
163+
matrix:
164+
include:
165+
- os: macos-latest
166+
platform: mac
167+
- os: windows-latest
168+
platform: win
169+
- os: ubuntu-latest
170+
platform: linux
171+
172+
steps:
173+
- name: Checkout repository
174+
uses: actions/checkout@v6
175+
176+
- name: Setup Node.js
177+
uses: actions/setup-node@v6
178+
with:
179+
node-version: '24'
180+
181+
- name: Setup pnpm
182+
uses: pnpm/action-setup@v4
183+
with:
184+
version: 10
185+
186+
- name: Get pnpm store directory
187+
shell: bash
188+
run: |
189+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
190+
191+
- name: Setup pnpm cache
192+
uses: actions/cache@v5
193+
with:
194+
path: ${{ env.STORE_PATH }}
195+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
196+
restore-keys: |
197+
${{ runner.os }}-pnpm-store-
198+
199+
- name: Extract version from tag
200+
id: version
201+
shell: bash
202+
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
203+
204+
- name: Update package.json version
205+
shell: bash
206+
working-directory: frontend/apps/web
207+
run: |
208+
npm pkg set version=${{ steps.version.outputs.version }}
209+
210+
- name: Install dependencies
211+
working-directory: frontend
212+
run: pnpm install
213+
214+
- name: Build Electron app
215+
working-directory: frontend/apps/web
216+
run: pnpm build:electron -- --${{ matrix.platform }}
217+
env:
218+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
219+
220+
- name: Upload artifacts to release
221+
uses: softprops/action-gh-release@v2
222+
with:
223+
prerelease: true
224+
files: |
225+
frontend/apps/web/release/*.dmg
226+
frontend/apps/web/release/*.zip
227+
frontend/apps/web/release/*.exe
228+
frontend/apps/web/release/*.AppImage
229+
frontend/apps/web/release/*.deb
230+
frontend/apps/web/release/*.rpm
231+
frontend/apps/web/release/*.yml
232+
frontend/apps/web/release/*.yaml
233+
env:
234+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
235+
236+
create-release:
237+
name: Create GitHub Pre-Release
238+
needs: [build-backend, build-web, build-admin, build-electron]
239+
runs-on: ubuntu-latest
240+
permissions:
241+
contents: write
242+
243+
steps:
244+
- name: Checkout repository
245+
uses: actions/checkout@v6
246+
247+
- name: Detect release type
248+
id: release_type
249+
run: |
250+
TAG="${GITHUB_REF_NAME}"
251+
if [[ "$TAG" == *"-alpha."* ]]; then
252+
echo "type=Alpha" >> $GITHUB_OUTPUT
253+
echo "emoji=⚠️" >> $GITHUB_OUTPUT
254+
elif [[ "$TAG" == *"-beta."* ]]; then
255+
echo "type=Beta" >> $GITHUB_OUTPUT
256+
echo "emoji=🧪" >> $GITHUB_OUTPUT
257+
elif [[ "$TAG" == *"-rc."* ]]; then
258+
echo "type=Release Candidate" >> $GITHUB_OUTPUT
259+
echo "emoji=🚀" >> $GITHUB_OUTPUT
260+
else
261+
echo "type=Pre-release" >> $GITHUB_OUTPUT
262+
echo "emoji=🔬" >> $GITHUB_OUTPUT
263+
fi
264+
265+
- name: Create Pre-Release
266+
uses: softprops/action-gh-release@v2
267+
with:
268+
prerelease: true
269+
generate_release_notes: true
270+
name: "${{ steps.release_type.outputs.emoji }} ${{ github.ref_name }} (${{ steps.release_type.outputs.type }})"
271+
body: |
272+
## ${{ steps.release_type.outputs.emoji }} This is a ${{ steps.release_type.outputs.type }}
273+
274+
> **Warning**: This is a pre-release version intended for testing purposes only.
275+
> Do not use in production environments.
276+
277+
## Docker Images
278+
279+
This pre-release includes the following Docker images:
280+
281+
```bash
282+
# Pull images
283+
docker pull ghcr.io/${{ env.IMAGE_PREFIX }}-backend:${{ github.ref_name }}
284+
docker pull ghcr.io/${{ env.IMAGE_PREFIX }}-web:${{ github.ref_name }}
285+
docker pull ghcr.io/${{ env.IMAGE_PREFIX }}-admin:${{ github.ref_name }}
286+
```
287+
288+
## Testing with Docker Compose
289+
290+
Create a `docker-compose.override.yml` file:
291+
292+
```yaml
293+
version: '3.8'
294+
295+
services:
296+
backend:
297+
image: ghcr.io/${{ env.IMAGE_PREFIX }}-backend:${{ github.ref_name }}
298+
299+
web:
300+
image: ghcr.io/${{ env.IMAGE_PREFIX }}-web:${{ github.ref_name }}
301+
302+
admin:
303+
image: ghcr.io/${{ env.IMAGE_PREFIX }}-admin:${{ github.ref_name }}
304+
```
305+
306+
Then run:
307+
308+
```bash
309+
docker compose up -d
310+
```
311+
312+
## Desktop Apps
313+
314+
Download the desktop application for your platform from the assets below.
315+
316+
**Note**: Desktop apps for pre-release versions will NOT auto-update.
317+
318+
## Feedback
319+
320+
Found an issue? Please report it at:
321+
https://github.com/${{ github.repository }}/issues
322+
323+
---
324+
325+
## Changelog
326+
327+
env:
328+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
329+

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
push:
55
tags:
66
- 'v*'
7+
# Exclude pre-release tags (alpha, beta, rc)
8+
- '!v*-alpha.*'
9+
- '!v*-beta.*'
10+
- '!v*-rc.*'
711

812
env:
913
REGISTRY: ghcr.io

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ docker compose --profile admin up -d
4242

4343
# Stop services
4444
docker compose down
45+
46+
# Test pre-release versions (alpha/beta/rc)
47+
IMAGE_TAG=v0.3.0-alpha.1 docker compose up -d
48+
# Or set in .env: IMAGE_TAG=v0.3.0-alpha.1
4549
```
4650

4751
### Development Environment

0 commit comments

Comments
 (0)