Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

Current actions, a Nix job, and the flake on FFmpeg 8

Jareerdf2d130746f8
diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml
index d5bfd751..98ce2e2e 100644
--- a/.github/workflows/build-app.yml
+++ b/.github/workflows/build-app.yml
@@ -40,7 +40,7 @@ jobs:
os: ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
@@ -111,7 +111,7 @@ jobs:
Copy-Item engine/target/app/concat.exe stage/
Copy-Item "$env:FFMPEG_DIR\bin\*.dll" stage/
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: Concat-${{ matrix.platform }}
path: stage
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 18a8483f..d84f1315 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -20,8 +20,10 @@ jobs:
env:
FFMPEG_LINUX: https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.1-latest-linux64-gpl-shared-8.1.tar.xz
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
+ with:
+ components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
@@ -49,12 +51,14 @@ jobs:
- run: cargo fmt --check
working-directory: engine
- - run: cargo test --workspace
- working-directory: engine
# -D warnings covers rustc lints too (missing_docs among them), so a
- # public item without documentation fails here, not in review.
+ # public item without documentation fails here, not in review. Lints
+ # before tests: they finish in a fraction of the time and catch the
+ # most.
- run: cargo clippy --workspace --all-targets -- -D warnings
working-directory: engine
+ - run: cargo test --workspace
+ working-directory: engine
app:
name: Build app
diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml
new file mode 100644
index 00000000..e2fa0cf5
--- /dev/null
+++ b/.github/workflows/nix.yml
@@ -0,0 +1,63 @@
+name: Nix
+
+# Proves the flake: `nix build` on Linux whenever the flake, the lock, or
+# the workspace's dependencies change, and on demand. The first run on a
+# tree without a flake.lock writes one and commits it, so the lock is
+# always the one CI built with.
+on:
+ push:
+ branches: [main]
+ paths:
+ - flake.nix
+ - flake.lock
+ - engine/Cargo.lock
+ - engine/Cargo.toml
+ - engine/crates/*/Cargo.toml
+ - .github/workflows/nix.yml
+ pull_request:
+ paths:
+ - flake.nix
+ - flake.lock
+ - engine/Cargo.lock
+ - .github/workflows/nix.yml
+ workflow_dispatch:
+
+concurrency:
+ group: nix-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ name: nix build
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@v7
+ - uses: DeterminateSystems/nix-installer-action@v22
+
+ - name: Lock the flake
+ run: nix flake lock
+
+ - name: Build
+ run: nix build .#concat --print-build-logs
+
+ # A window cannot open on the runner, so the check is that the binary
+ # is there, links, and resolves every library it needs.
+ - name: Check the binary links
+ run: |
+ file result/bin/.concat-wrapped || file result/bin/concat
+ ldd result/bin/.concat-wrapped 2>/dev/null | grep -i 'not found' && exit 1 || true
+
+ # A lock CI wrote is a lock the repo should carry: the next run then
+ # builds exactly this, and so does everyone running `nix build`.
+ - name: Commit the lock
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
+ run: |
+ if git status --porcelain flake.lock | grep -q .; then
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git add flake.lock
+ git commit -m "Lock the flake"
+ git push
+ fi
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ef758138..c02f98ba 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -22,7 +22,7 @@ jobs:
permissions:
contents: write
steps:
- - uses: actions/download-artifact@v4
+ - uses: actions/download-artifact@v8
with:
path: bundles
@@ -36,7 +36,7 @@ jobs:
(cd bundles/Concat-windows && zip -qr "../../out/Concat-${tag}-windows-x86_64.zip" .)
ls -l out
- - uses: softprops/action-gh-release@v2
+ - uses: softprops/action-gh-release@v3
with:
name: Concat ${{ github.ref_name }}
prerelease: ${{ contains(github.ref_name, '-') }}
diff --git a/flake.nix b/flake.nix
index c8027ae9..be86ce27 100644
--- a/flake.nix
+++ b/flake.nix
@@ -11,9 +11,9 @@
# in sync. Three native pieces need care inside the sandbox, which has no
# network:
#
- # - FFmpeg is linked, not spawned. nixpkgs' ffmpeg (7+) provides the
- # headers and libraries; bindgen finds them through pkg-config and
- # bindgenHook's libclang.
+ # - FFmpeg is linked, not spawned. nixpkgs' ffmpeg_8 provides the headers
+ # and libraries; bindgen finds them through pkg-config and bindgenHook's
+ # libclang.
# - whisper.cpp is compiled in by cmake from the source vendored inside
# whisper-rs-sys, so it needs cmake and a C++ toolchain and nothing else.
# - sherpa-onnx (text to speech) links prebuilt static libraries that its
@@ -88,7 +88,9 @@
buildInputs =
pkgs: with pkgs; [
- ffmpeg
+ # 8, by name: the engine needs 7 or newer, and nixpkgs' unversioned
+ # `ffmpeg` is whichever major the distribution defaults to.
+ ffmpeg_8
alsa-lib
fontconfig
freetype