Overview
Reqbook is a single static binary with stable exit codes, making it straightforward to integrate into any CI pipeline. Common use cases include: validating specs on every pull request, running endpoint tests against staging before a deployment, and detecting secrets committed to spec files before they reach the remote. See the Exit codes reference for a full list of codes and what triggers each one.Release automation
This repository ships a tag-based release workflow at.github/workflows/release.yml. Push a tag like v0.1.0, or run the release workflow manually with an existing v* tag, to build release binaries, package the VS Code extension, create a GitHub Release, and optionally publish to external package managers.
Package-manager publishing is gated by GitHub repository variables. Leave a variable unset or set it to false to keep that channel disabled while still producing GitHub Release artifacts.
GitHub Release artifacts
The release workflow must publish these binary assets because the shell, PowerShell, and npm installers download by exact asset name:| Platform | Required asset |
|---|---|
| macOS Apple Silicon | rqb-aarch64-apple-darwin.tar.xz |
| macOS Intel | rqb-x86_64-apple-darwin.tar.xz |
| Linux ARM64 | rqb-aarch64-unknown-linux-musl.tar.xz |
| Linux x64 | rqb-x86_64-unknown-linux-musl.tar.xz |
| Windows x64 | rqb-x86_64-pc-windows-msvc.zip |
| VS Code | reqbook-vscode-<tag>.vsix |
.sha256 file. The workflow fails before and after creating the GitHub Release if any required asset is missing.
Manual release trigger
Manual release runs are for retrying or promoting an existing tag. Create and push the tag first:release workflow, click Run workflow, and enter:
| Input | Value |
|---|---|
tag | Existing tag, for example v0.1.0. |
draft | true only when you want to review the GitHub Release before publishing. |
prerelease | true for alpha, beta, rc, or early public builds. |
main branch. The tag must start with v.
Required GitHub configuration
| Channel | GitHub Secret | Repository Variable | Notes |
|---|---|---|---|
| GitHub Releases | none | none | Uses the built-in GITHUB_TOKEN with contents: write. |
| GHCR Docker image | none | none | Uses the built-in GITHUB_TOKEN with packages: write; publishes ghcr.io/<owner>/rqb:<tag> and latest. |
| crates.io | CARGO_REGISTRY_TOKEN | PUBLISH_CRATES=true | Token must be allowed to publish the reqbook crate. |
| npm | NPM_TOKEN | PUBLISH_NPM=true | Token must publish the reqbook package; workflow uses npm provenance. |
| Visual Studio Marketplace | VSCE_PAT | PUBLISH_VSCODE=true | PAT must manage the reqbook publisher. |
| Open VSX | OVSX_PAT | PUBLISH_OPEN_VSX=true | Token must publish under the manifest publisher namespace. |
| Homebrew tap | HOMEBREW_TAP_TOKEN | PUBLISH_HOMEBREW=true | Reserved for a tap update job; this repository does not update a tap yet. |
| Variable | Example | Purpose |
|---|---|---|
HOMEBREW_TAP_REPOSITORY | ngoclinh93qt/homebrew-tap | Target tap repository. |
HOMEBREW_FORMULA_NAME | rqb | Formula file/name to update. |
Setting secrets and variables
RQB_* runtime API credentials as release publishing secrets unless a CI test needs them. RQB_* values are for executing API specs, while the package-manager tokens above are for publishing artifacts.
GitHub Actions
Install Reqbook
Add a step to download the binary. The install script detects the platform automatically.
Validate specs
Run
rqb validate against the entire api-docs/ directory. Exit code 2 means a spec has a structural error; exit code 5 means a secret was committed.Run endpoint tests
Pass secrets via
RQB_* environment variables. They map automatically to camel-case variable names in your specs.Full workflow example
JUnit reports
Generate JUnit XML output for CI test reporters. Most CI systems can parse JUnit XML to display per-test results inline in pull request checks.Passing secrets safely
UseRQB_* environment variables to inject secrets. The RQB_ prefix is stripped and the name is converted to lower camel case before variable resolution.
Exit code handling
GitLab CI
Pinning the binary version
For reproducible CI builds, pin the Reqbook version explicitly rather than always installing the latest release.bin/rqb and reference it directly. The binary is statically linked and has no runtime dependencies.