Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/alert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ on:
- moq-relay
- Nightly
- release-brew
- Release C++
- Release Dart
- Release Dart FFI
- Release Go
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: C++

# Compiles the generated moq-ffi C++ bindings with clang, outside Nix. `just
# Builds and tests the moq C++ package (cpp/moq) with clang, outside Nix. `just
# check` already runs `just cpp check` with the dev shell's gcc; the dev shell
# has no clang++, and adding one would change which compiler every other recipe
# gets as `cc`. MSVC runs in nightly.yml, for the reason the Windows Rust check
Expand All @@ -18,9 +18,12 @@ on:
# via the concurrency group below; the job itself is skipped on close.
types: [opened, synchronize, reopened, closed]
paths:
- "cpp/ffi/**"
- "cpp/moq/**"
- "cpp/justfile"
- "rs/moq-ffi/**"
- "rs/libmoq/native-libs/**"
- "doc/lib/cpp/**"
- "doc/lib/samples.sh"
- "Cargo.lock"
- ".github/workflows/cpp.yml"

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
- "package.json"
# The Go client builds against the modules this script stages.
- "go/scripts/**"
- "cpp/moq/**"
- ".github/workflows/interop.yml"

concurrency:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ jobs:
permissions:
contents: write

release-cpp:
name: Release C++
uses: ./.github/workflows/release-cpp.yml
permissions:
contents: write

release-moq-relay:
name: moq-relay
uses: ./.github/workflows/moq-relay.yml
Expand Down Expand Up @@ -295,8 +301,7 @@ jobs:
shell: bash
run: just rs windows

# The generated moq-ffi C++ bindings under MSVC, with exceptions and RTTI
# off. cpp.yml covers clang on pull requests and `just check` covers gcc; this
# The moq C++ package (cpp/moq) under MSVC, with exceptions and RTTI off. cpp.yml covers clang on pull requests and `just check` covers gcc; this
# is the Windows half, nightly for the same runner cost as `windows`.
cpp-windows:
name: C++ (MSVC)
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/release-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Release C++

# Builds the moq C++ package (cpp/moq) for every target and publishes one archive per
# target to a cpp-v<version> GitHub release. The vcpkg and Conan packages fetch these.

on:
push:
tags:
- "cpp-v*"
# Dry-run: build everything, publish nothing. Nightly calls every release
# workflow this way so a broken build surfaces before the tag is cut.
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable

# aws-lc-rs assembles its x86_64 crypto with NASM on Windows.
- name: Install NASM
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install nasm -y --no-progress
"C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

# The tag flake.nix pins; see the comment there.
- name: Install uniffi-bindgen-cpp
shell: bash
run: cargo install uniffi-bindgen-cpp --locked --git https://github.com/kixelated/uniffi-bindgen-cpp --tag v0.11.0-kixelated.1+v0.32.2

# The package version lives in cpp/moq/VERSION; a tag that disagrees is a mistake.
- name: Check version
if: github.ref_type == 'tag'
shell: bash
env:
TAG: ${{ github.ref_name }}
run: |
version=$(tr -d '[:space:]' < cpp/moq/VERSION)
if [[ "$TAG" != "cpp-v$version" ]]; then
echo "::error::tag $TAG does not match cpp/moq/VERSION ($version)"
exit 1
fi

- name: Build and package
shell: bash
env:
TARGET: ${{ matrix.target }}
run: ./cpp/moq/build.sh --target "$TARGET" --output dist

- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: moq-cpp-${{ matrix.target }}
path: dist/*

release:
name: Release
needs: build
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Find previous tag
id: prev_tag
run: .github/scripts/release.sh prev-tag cpp

- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
path: artifacts
merge-multiple: true

- name: Create or update release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
RELEASE_PREV_TAG: ${{ steps.prev_tag.outputs.tag }}
run: RELEASE_TITLE="moq C++ v${RELEASE_TAG#cpp-v}" .github/scripts/release.sh create artifacts
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ These diff the branch against its base and only run the affected packages.

| Change in | Also update |
|---|---|
| `rs/moq-ffi` | `rs/libmoq`, `{py,swift,kt,dart}/`, `go/wrapper/moq/*.go` (the `go/ffi` and `dart/moq_ffi` bindings regenerate automatically, but a new method needs a hand-written wrapper too, like `py/moq-rs` or `dart/moq`), `doc/lib/{py,swift,kt,go,dart,c}` |
| `rs/moq-ffi` | `rs/libmoq`, `{py,swift,kt,dart}/`, `go/wrapper/moq/*.go` (the `go/ffi` and `dart/moq_ffi` bindings regenerate automatically, but a new method needs a hand-written wrapper too, like `py/moq-rs` or `dart/moq`), `cpp/moq`, `doc/lib/{py,swift,kt,go,dart,c,cpp}` |
| `rs/moq-net` wire/API | `js/net`, `doc/concept`, `drafts/draft-lcurley-moq-lite.md` (if the wire spec changes) |
| `rs/hang` catalog/container | `js/hang`, `doc/concept`, `drafts/draft-lcurley-moq-hang.md` (if the format spec changes) |
| `rs/moq-token` | `js/token` |
Expand Down
3 changes: 0 additions & 3 deletions cpp/ffi/.gitignore

This file was deleted.

34 changes: 0 additions & 34 deletions cpp/ffi/CMakeLists.txt

This file was deleted.

32 changes: 0 additions & 32 deletions cpp/ffi/README.md

This file was deleted.

125 changes: 0 additions & 125 deletions cpp/ffi/probe.cpp

This file was deleted.

Loading
Loading