Skip to content

Commit 8f8748d

Browse files
authored
feat: update version to 0.7.8 and add linux daemon (#116)
* feat: update version to 0.7.8 and add linux daemon - Bumped version number to 0.7.8 in VERSION. - Updated .gitignore to include additional build artifacts and directories. - Modified CMakeLists.txt to add an option for building shared libraries and conditionally include Linux-specific subdirectories. - Enhanced GitHub Actions workflows to use pnpm for dependency management and building the website. - Added new release workflow for building and publishing Debian packages. - Documented the Linux update path and release process in new markdown files. * feat: add GitHub Actions workflows for building base image and updating deployment processes - Introduced a new workflow for building and pushing a static dependencies base image to GHCR. - Updated the deploy-website and pr-check workflows to use npm instead of pnpm for dependency management and building. - Enhanced the pr-check workflow to include a new job for building .deb packages and added checks for relevant changes. - Improved the release workflow to pull the base image from GHCR and fallback to local build if necessary.
1 parent aaed427 commit 8f8748d

96 files changed

Lines changed: 12067 additions & 358 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-base.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build Base Image
2+
3+
# Builds the static-deps base image (ffmpeg / x264 / opus / libyuv / curl
4+
# all compiled static against jammy's glibc 2.35) and pushes it to GHCR
5+
# as ghcr.io/78/tenbox-build:jammy-<arch>. Both release.yml and
6+
# pr-check.yml just `docker pull` this image and run cmake against the
7+
# bind-mounted source tree, which keeps PR builds short and avoids
8+
# recompiling ffmpeg on every commit.
9+
#
10+
# Trigger:
11+
# - push to main that touches packaging/build-base/** (rebuilds + pushes)
12+
# - manual workflow_dispatch (for re-pushing after a registry hiccup)
13+
#
14+
# Image tags written:
15+
# jammy-amd64 / jammy-arm64 -> the rolling tag used by downstream jobs
16+
# jammy-<sha7>-<arch> -> immutable tag for one-off pinning
17+
18+
on:
19+
push:
20+
branches: [main]
21+
paths:
22+
- 'packaging/build-base/**'
23+
- '.github/workflows/build-base.yml'
24+
workflow_dispatch:
25+
26+
permissions:
27+
contents: read
28+
packages: write
29+
30+
jobs:
31+
build-and-push:
32+
name: Build base (${{ matrix.arch }})
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
include:
37+
- { runner: ubuntu-22.04, arch: amd64 }
38+
- { runner: ubuntu-22.04-arm, arch: arm64 }
39+
runs-on: ${{ matrix.runner }}
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Compute short sha
45+
id: meta
46+
run: echo "sha7=$(echo "${GITHUB_SHA}" | cut -c1-7)" >> "$GITHUB_OUTPUT"
47+
48+
- name: Set up Docker buildx
49+
uses: docker/setup-buildx-action@v3
50+
51+
- name: Login to GHCR
52+
uses: docker/login-action@v3
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.actor }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Build and push
59+
uses: docker/build-push-action@v5
60+
with:
61+
context: packaging/build-base
62+
file: packaging/build-base/Dockerfile.jammy
63+
push: true
64+
tags: |
65+
ghcr.io/78/tenbox-build:jammy-${{ matrix.arch }}
66+
ghcr.io/78/tenbox-build:jammy-${{ steps.meta.outputs.sha7 }}-${{ matrix.arch }}
67+
cache-from: type=gha,scope=build-base-${{ matrix.arch }}
68+
cache-to: type=gha,scope=build-base-${{ matrix.arch }},mode=max

.github/workflows/deploy-website.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ jobs:
2525
- uses: actions/setup-node@v4
2626
with:
2727
node-version: 20
28+
cache: npm
29+
cache-dependency-path: website/package-lock.json
2830

2931
- name: Install dependencies
30-
run: npm install
32+
run: npm ci
3133
working-directory: website
3234

3335
- name: Build

.github/workflows/pr-check.yml

Lines changed: 101 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,16 @@ on:
44
pull_request:
55
branches: [main]
66

7+
permissions:
8+
contents: read
9+
packages: read
10+
711
jobs:
8-
build-cpp:
9-
name: Build C++ Project (${{ matrix.os }})
12+
build-windows:
13+
name: Build C++ Project (windows-latest)
1014
if: >-
1115
github.event_name == 'pull_request'
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
fail-fast: false
15-
matrix:
16-
include:
17-
- os: windows-latest
18-
configure_args: -A x64 -DCMAKE_BUILD_TYPE=Release
19-
build_args: --config Release --parallel
20-
artifact_name: tenbox-build-windows
21-
artifact_path: build/Release/*.exe
22-
- os: ubuntu-latest
23-
configure_args: -DCMAKE_BUILD_TYPE=Release
24-
build_args: --parallel
25-
artifact_name: tenbox-build-linux-x64
26-
artifact_path: build/tenbox-vm-runtime
27-
- os: ubuntu-24.04-arm
28-
configure_args: -DCMAKE_BUILD_TYPE=Release
29-
build_args: --parallel
30-
artifact_name: tenbox-build-linux-arm64
31-
artifact_path: build/tenbox-vm-runtime
16+
runs-on: windows-latest
3217
steps:
3318
- uses: actions/checkout@v4
3419

@@ -44,23 +29,108 @@ jobs:
4429
4530
- name: Configure CMake
4631
if: steps.changes.outputs.src == 'true'
47-
run: cmake -B build ${{ matrix.configure_args }}
32+
run: cmake -B build -A x64 -DCMAKE_BUILD_TYPE=Release
4833

4934
- name: Build
5035
if: steps.changes.outputs.src == 'true'
51-
run: cmake --build build ${{ matrix.build_args }}
36+
run: cmake --build build --config Release --parallel
5237

5338
- name: Upload build artifacts
5439
if: steps.changes.outputs.src == 'true'
5540
uses: actions/upload-artifact@v4
5641
with:
57-
name: ${{ matrix.artifact_name }}
58-
path: ${{ matrix.artifact_path }}
42+
name: tenbox-build-windows
43+
path: build/Release/*.exe
5944

6045
- name: Skip notice
6146
if: steps.changes.outputs.src != 'true'
6247
run: echo "No changes in src/, skipping C++ build."
6348

49+
build-deb:
50+
name: Build .deb (${{ matrix.arch }})
51+
if: >-
52+
github.event_name == 'pull_request'
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
include:
57+
- { runner: ubuntu-22.04, arch: amd64 }
58+
- { runner: ubuntu-22.04-arm, arch: arm64 }
59+
runs-on: ${{ matrix.runner }}
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
# Same gate as the windows job: only run when something that
64+
# affects the binary actually changed. packaging/** is included
65+
# so packaging-only PRs still validate the deb pipeline.
66+
- name: Check relevant changes
67+
id: changes
68+
uses: dorny/paths-filter@v3
69+
with:
70+
filters: |
71+
src:
72+
- 'src/**'
73+
- 'CMakeLists.txt'
74+
- 'tests/**'
75+
- 'packaging/**'
76+
- '.github/workflows/pr-check.yml'
77+
78+
- name: Login to GHCR
79+
if: steps.changes.outputs.src == 'true'
80+
uses: docker/login-action@v3
81+
with:
82+
registry: ghcr.io
83+
username: ${{ github.actor }}
84+
password: ${{ secrets.GITHUB_TOKEN }}
85+
86+
# The base image is produced by .github/workflows/build-base.yml.
87+
# For PRs we deliberately do NOT fall back to building the image
88+
# locally: that would add ~25 minutes to the run on a cold cache.
89+
# If the pull fails the PR author should rerun build-base.yml.
90+
- name: Pull static-deps base image
91+
if: steps.changes.outputs.src == 'true'
92+
run: docker pull ghcr.io/78/tenbox-build:jammy-${{ matrix.arch }}
93+
94+
- name: Compile tenbox (static)
95+
if: steps.changes.outputs.src == 'true'
96+
run: |
97+
set -euo pipefail
98+
docker run --rm \
99+
-v "${{ github.workspace }}:/src" \
100+
-w /src \
101+
ghcr.io/78/tenbox-build:jammy-${{ matrix.arch }} \
102+
bash -lc '
103+
set -euo pipefail
104+
cmake -B build -G Ninja \
105+
-DCMAKE_BUILD_TYPE=Release \
106+
-DTENBOX_STATIC_FFMPEG=ON
107+
cmake --build build --parallel
108+
strip build/tenbox build/tenboxd build/tenbox-vm-runtime
109+
'
110+
111+
# PR builds use the VERSION file as-is so we exercise the same
112+
# script the release runs. The resulting .deb is throwaway -
113+
# only used to confirm the packaging pipeline is healthy.
114+
- name: Build .deb
115+
if: steps.changes.outputs.src == 'true'
116+
run: |
117+
set -euo pipefail
118+
version="$(cat VERSION | head -n1 | tr -d '[:space:]')"
119+
packaging/debian/build-deb.sh "${{ matrix.arch }}" "${version}"
120+
121+
- name: Upload .deb artifact
122+
if: steps.changes.outputs.src == 'true'
123+
uses: actions/upload-artifact@v4
124+
with:
125+
name: tenbox-deb-${{ matrix.arch }}
126+
path: |
127+
dist/tenbox_*_${{ matrix.arch }}.deb
128+
dist/tenbox_*_${{ matrix.arch }}.deb.sha256
129+
130+
- name: Skip notice
131+
if: steps.changes.outputs.src != 'true'
132+
run: echo "No changes in src/ or packaging/, skipping .deb build."
133+
64134
build-website:
65135
name: Build Website
66136
if: >-
@@ -81,13 +151,15 @@ jobs:
81151
if: steps.changes.outputs.website == 'true'
82152
with:
83153
node-version: 20
154+
cache: npm
155+
cache-dependency-path: website/package-lock.json
84156

85-
- name: Install dependencies
157+
- name: Install website dependencies
86158
if: steps.changes.outputs.website == 'true'
87-
run: npm install
159+
run: npm ci
88160
working-directory: website
89161

90-
- name: Build
162+
- name: Build website
91163
if: steps.changes.outputs.website == 'true'
92164
run: npm run build
93165
working-directory: website

0 commit comments

Comments
 (0)