Skip to content

CI CD and Releases

Chuck edited this page Nov 30, 2026 · 4 revisions

Glint ships pipelines for GitHub Actions (used by this repository) and for self-hosted GitLab (for people who mirror Glint into their own GitLab). Both follow the same model: work merges into dev, and every merge into main cuts a release. Versions follow Semantic Versioning.


Branch flow

flowchart LR
    F["feature/… fix/… chore/…"] -- "pull request<br/>CI must pass" --> D["dev"]
    D -- "push" --> DI["image :dev"]
    D -- "release pull request" --> M["main"]
    M -- "push" --> R["tag vX.Y.Z<br/>images :vX.Y.Z + :latest<br/>GitHub Release"]
Loading

GitHub Actions

ci.yml — checks

Runs on pull requests, on demand (Run workflow / workflow_dispatch), and as part of release.yml. It doesn't run on plain branch pushes, so a PR branch is checked once.

Job What it does
Secret scan gitleaks over the full git history (pinned release binary, SHA-256 verified)
Build and test npm ci, type check of source and tests (npm run typecheck), compile (tests excluded), Vitest with coverage; uploads the coverage report
Typecheck e2e harness Compiles e2e-test/ (the e2e run itself needs an API key, so it isn't run in CI)
Docker build Builds the image without pushing

release.yml — publishing

Runs on every push to dev or main, after the full CI suite passes.

Branch Result
dev Pushes ghcr.io/smith8ca/glint:dev
main Computes the next version, pushes :vX.Y.Z and :latest, creates the tag and a GitHub Release with generated notes

Images are built for linux/amd64 and linux/arm64 with Buildx and QEMU, use the GitHub Actions build cache, and carry build attestations.

Version numbers. The workflow reads the newest versioned heading in CHANGELOG.md, such as ## [1.1.0]. If it is higher than the highest existing vX.Y.Z tag, that becomes the version: this is how a minor or major release is made (v1.0.0 was the first). Otherwise the workflow adds one to the patch number of the highest tag. The GitLab CI release job uses the same rule.

Duplicate guard. A Check release tag job looks for a vX.Y.Z tag on the pushed commit. On main, if one exists, Publish is skipped with a notice, so pushing an already-released commit doesn't cut a second release.

No repository secrets are needed: the built-in GITHUB_TOKEN pushes to GHCR and creates releases.


Making a release

  1. Prepare the changelog on a chore/release-X.Y.Z branch: move the [Unreleased] entries under ## [X.Y.Z] - YYYY-MM-DD, update the compare links at the bottom, and merge it into dev through a pull request.
  2. Open a pull request from dev into main, titled Release vX.Y.Z.
  3. Merge it once CI passes. Don't squash: a merge commit keeps dev and main histories aligned.
  4. release.yml tags the merge commit, publishes the images and creates the GitHub Release (about two minutes).
  5. Check the run in the Actions tab, the new entry under Releases, and that ghcr.io/smith8ca/glint:vX.Y.Z pulls.

Never push directly to main.


Local secret scanning

.githooks/pre-commit runs gitleaks git --pre-commit --staged --redact and blocks a commit that contains a credential. Enable it once per clone:

git config core.hooksPath .githooks

The CI Secret scan job catches anything committed with --no-verify. For a deliberate fake value in a test, add // gitleaks:allow to that line.


GitLab CI (self-hosted)

.gitlab-ci.yml mirrors the same flow for a GitLab instance:

Stage Job Runs on Result
test sast Every push GitLab SAST template (non-blocking)
test unit-test Every push Vitest with LCOV report
test sonar-scan MRs, main, dev SonarQube analysis using the LCOV report (non-blocking)
secret-detection secret_detection Every push GitLab Secret Detection template
build typecheck Every push Type check of source and tests, then compile
publish release Push to main Creates the next vX.Y.Z tag via the GitLab API; exits without one if the commit is already tagged
publish publish:dev Push to dev Pushes glint:dev to the project's container registry
publish publish:tag Tag vX.Y.Z Pushes :vX.Y.Z and :latest, creates a GitLab Release

If Glint is itself configured as a webhook on that GitLab project, its Release Hook then fills in the new release's description — Glint writing its own release notes.

CI/CD variables

Variable Required Purpose
RELEASE_TOKEN Yes Project access token (api, write_repository, Developer or above) used to create tags and releases
SONAR_HOST_URL For SonarQube Server URL; its host is used to trust a self-signed certificate
SONAR_TOKEN For SonarQube Analysis token
SONAR_PROJECT_KEY No Overrides sonar.projectKey in sonar-project.properties
PROD_URL, DEVL_URL No Links shown under Operate → Environments

Publish jobs expect shell runners tagged shell (no Docker-in-Docker). If the registry uses a private CA, each runner host must trust it under /etc/docker/certs.d/<registry-host>/ca.crt — the README's GitLab CI section has a one-time setup command.

Clone this wiki locally