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
6 changes: 4 additions & 2 deletions .github/workflows/cachix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
# Build and push only the package the tag names. The tag prefix
# (e.g. moq-relay) maps 1:1 to a flake attribute.
# (e.g. moq-relay) is the flake attribute, except moq-cli ships as moq.
release:
name: Release (${{ matrix.os }})
runs-on: ${{ matrix.runs-on }}
Expand Down Expand Up @@ -48,7 +48,9 @@ jobs:
echo "Tag format not recognized: $REF_NAME" >&2
exit 1
fi
echo "name=${BASH_REMATCH[1]}" >> "$GITHUB_OUTPUT"
name="${BASH_REMATCH[1]}"
[[ "$name" == moq-cli ]] && name=moq
echo "name=${name}" >> "$GITHUB_OUTPUT"

- uses: DeterminateSystems/nix-installer-action@1d87d45818068401a10cf16bdc5f00b24994a83f # main
with:
Expand Down
45 changes: 31 additions & 14 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:
workflow_call:
inputs:
package:
description: "Flake package to build (moq-relay, moq-cli)"
description: "Crate to build (moq-relay, moq-cli)"
required: true
type: string
workflow_dispatch:
inputs:
package:
description: "Flake package to build (moq-relay, moq-cli)"
description: "Crate to build (moq-relay, moq-cli)"
required: true
type: string
default: moq-relay
Expand All @@ -32,7 +32,7 @@ jobs:
permissions:
contents: read
outputs:
target: ${{ steps.parse.outputs.target }}
package: ${{ steps.parse.outputs.package }}
version: ${{ steps.parse.outputs.version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -41,19 +41,24 @@ jobs:

- id: parse
env:
PACKAGE: ${{ inputs.package }}
CRATE: ${{ inputs.package }}
run: |
ref=${GITHUB_REF#refs/tags/}
if [[ -n "$PACKAGE" ]]; then
target="$PACKAGE"
if [[ -n "$CRATE" ]]; then
crate="$CRATE"
elif [[ "$ref" =~ ^([a-z-]+)-v[0-9.]+$ ]]; then
target="${BASH_REMATCH[1]}"
crate="${BASH_REMATCH[1]}"
else
echo "Tag format not recognized." >&2
exit 1
fi
echo "target=${target}" >> "$GITHUB_OUTPUT"
.github/scripts/release.sh parse-version "$target"
# The flake package and image are named after the executable.
case "$crate" in
moq-cli) package=moq ;;
*) package="$crate" ;;
esac
echo "package=${package}" >> "$GITHUB_OUTPUT"
.github/scripts/release.sh parse-version "$crate"

build:
name: Build ${{ matrix.platform }}
Expand Down Expand Up @@ -89,8 +94,8 @@ jobs:
context: .
platforms: ${{ matrix.platform }}
build-args: |
package=${{ needs.parse.outputs.target }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ needs.parse.outputs.target }},push-by-digest=true,name-canonical=true,push=${{ github.ref_type == 'tag' }}
package=${{ needs.parse.outputs.package }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ needs.parse.outputs.package }},push-by-digest=true,name-canonical=true,push=${{ github.ref_type == 'tag' }}

- name: Export digest
if: github.ref_type == 'tag'
Expand Down Expand Up @@ -132,6 +137,18 @@ jobs:
run: |
# shellcheck disable=SC2046 # intentional word-splitting: one arg per digest
docker buildx imagetools create \
-t ${{ env.REGISTRY }}/${{ needs.parse.outputs.target }}:${{ needs.parse.outputs.version }} \
-t ${{ env.REGISTRY }}/${{ needs.parse.outputs.target }}:latest \
$(printf "${{ env.REGISTRY }}/${{ needs.parse.outputs.target }}@sha256:%s " *)
-t ${{ env.REGISTRY }}/${{ needs.parse.outputs.package }}:${{ needs.parse.outputs.version }} \
-t ${{ env.REGISTRY }}/${{ needs.parse.outputs.package }}:latest \
$(printf "${{ env.REGISTRY }}/${{ needs.parse.outputs.package }}@sha256:%s " *)

# The image was moqdev/moq-cli through 0.12.2. Point `latest` there at a
# refusal naming the new image, so a user tracking it breaks instead of
# silently staying on 0.12.2. Pinned versions keep working.
- name: Refuse the old image name
if: needs.parse.outputs.package == 'moq'
run: |
docker buildx build --platform linux/amd64,linux/arm64 --push \
-t ${{ env.REGISTRY }}/moq-cli:latest - <<'DOCKERFILE'
FROM busybox:stable
ENTRYPOINT ["sh", "-c", "echo 'error: moqdev/moq-cli is now moqdev/moq' >&2; exit 1"]
DOCKERFILE
2 changes: 1 addition & 1 deletion .github/workflows/release-winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
crate="${BASH_REMATCH[1]}"
version="${BASH_REMATCH[2]}"
case "$crate" in
moq-cli) identifier="moq-dev.moq-cli" ;;
moq-cli) identifier="moq-dev.moq" ;;
moq-relay) identifier="moq-dev.moq-relay" ;;
*)
echo "No winget identifier mapped for crate: $crate" >&2
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/nix,from=n
ARG package="sh"

# Create entry.sh script that knows which binary to run. Derive it from the
# single binary the package produced (so a crate whose `[[bin]]` name differs
# from its package name, e.g. `moq-cli` shipping as `moq`, just works); fall
# back to the package name when there's no binary (the `sh` default).
# single binary the package produced, so a package need not share its binary's
# name; fall back to the package name when there's no binary (the `sh` default).
RUN binary="$(ls /output/result/bin 2>/dev/null | head -n1)"; \
[ -n "$binary" ] || binary="${package}"; \
printf '#!/bin/sh\nexec /bin/%s "$@"\n' "${binary}" > /output/entry.sh && \
Expand Down
14 changes: 8 additions & 6 deletions doc/setup/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ Two binaries and two plugins ship prebuilt:
| GStreamer plugin | `moqsink`, `moqsrc` | [GStreamer](/bin/gstreamer) elements |
| OBS plugin | | [OBS Studio](/bin/obs) output and source |

Homebrew and Linux package names match the executables. Cargo crates and
Windows package IDs retain `moq-cli`. Existing Homebrew
Package names match the executables everywhere except crates.io, where the
crate is `moq-cli`. Existing Homebrew
installs migrate through formula renames; apt upgrades use transitional
packages, and dnf replaces the old packages.
packages, and dnf replaces the old packages. The `moqdev/moq-cli` Docker image
and the `#moq-cli` flake package stop at 0.12.2 and now exit with an error
naming `moqdev/moq` and `#moq`.

Use `moq auth` for keys and tokens; installing `moq` includes it.

Expand All @@ -32,11 +34,11 @@ brew install moq-dev/tap/moq-relay moq-dev/tap/moq

# Nix (pin a release tag to use the binary cache)
nix run github:moq-dev/moq#moq-relay -- relay.toml
nix run github:moq-dev/moq#moq-cli -- --help
nix run github:moq-dev/moq#moq -- --help

# Docker (linux/amd64 and linux/arm64)
docker run -p 4443:4443/udp -p 4443:4443/tcp -v "$PWD/relay.toml:/app/relay.toml:ro" moqdev/moq-relay /app/relay.toml
docker run -i moqdev/moq-cli --help
docker run -i moqdev/moq --help
```

Static binaries for Linux (x86\_64, aarch64), macOS (Apple Silicon), and Windows
Expand Down Expand Up @@ -87,7 +89,7 @@ works without root, and config edits survive upgrades.

```powershell
winget install moq-dev.moq-relay
winget install moq-dev.moq-cli
winget install moq-dev.moq
```

The OBS plugin ships as a zip for Windows x64 and macOS arm64 on the
Expand Down
14 changes: 12 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,24 @@
name = "moq-all";
paths = [
moq-relay
moq-cli
moq
];
};

# Named after the executable. The overlay keeps `moq-cli` because
# nixpkgs already has an unrelated `moq`.
moq = overlayPkgs.moq-cli;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Move the published package rename to dev

Because this commit is based on main, replacing packages.moq-cli with only packages.moq makes every unpinned nix ...#moq-cli invocation fail as soon as main advances; the same release also stops updating moqdev/moq-cli. These are published consumer names that worked through 0.12.1, so this is a breaking distribution-surface change on the additive branch. Retarget the rename to dev rather than landing it on main.

AGENTS.md reference: AGENTS.md:L60-L60

Useful? React with 馃憤聽/ 馃憥.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept on main by maintainer decision. The old names refuse loudly instead of going stale: moqdev/moq-cli:latest becomes a stub that exits 1 naming moqdev/moq, and #moq-cli is a script that does the same. moq-cli 0.12.2 shipped under the old names before this merges.

(written by Claude Opus 5.5)


# The package was `moq-cli` through 0.12.2. Refuse with the new name
# so `nix run` and `nix profile upgrade` break instead of going stale.
moq-cli = pkgs.writeShellScriptBin "moq" ''
echo "error: the moq-cli package is now moq: nix run github:moq-dev/moq#moq" >&2
exit 1
'';

# Inherit packages from the overlay
inherit (overlayPkgs)
moq-relay
moq-cli
moq-bench
moq-boy
libmoq
Expand Down
4 changes: 2 additions & 2 deletions rs/moq-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ cargo install moq-cli
### Docker

```bash
docker pull moqdev/moq-cli
docker pull moqdev/moq
```

Multi-arch images (`linux/amd64` and `linux/arm64`) are published to [Docker Hub](https://hub.docker.com/r/moqdev/moq-cli).
Multi-arch images (`linux/amd64` and `linux/arm64`) are published to [Docker Hub](https://hub.docker.com/r/moqdev/moq).

## Usage

Expand Down
Loading