CI/CD & Publishing
CI Pipeline
The CI pipeline runs on every push and pull request via GitHub Actions:
- Typecheck (
bun run typecheck) —tsc --noEmit - Lint (
bun run lint) — Biome check - Unit tests (
bun run test) - E2E tests (
bun run test:e2e)
Publishing Flow
Platform Binaries
| Platform | Package |
|---|---|
| macOS Apple Silicon | @ahoo-wang/godex-darwin-arm64 |
| macOS Intel | @ahoo-wang/godex-darwin-x64 |
| Linux x86_64 | @ahoo-wang/godex-linux-x64 |
| Linux ARM64 | @ahoo-wang/godex-linux-arm64 |
| Windows x86_64 | @ahoo-wang/godex-win32-x64 |
| Windows ARM64 | @ahoo-wang/godex-win32-arm64 |
Package Architecture
The main @ahoo-wang/godex npm package is a lightweight shell:
engines: { node: ">=18.0.0" }— only needed duringpostinstallpostinstall: scripts/install.cjs— detects platform, links binaryoptionalDependencies— platform-specific packages
Release Workflow
- A GitHub Release tagged
vX.Y.Ztriggers the Release workflow - Checks job runs typecheck, lint, unit tests, and mock e2e
- Compile job builds all 6 platform binaries (parallel, one per platform runner)
- Publish job downloads binaries, packages archives with SHA256 checksums, uploads to Release Assets, and publishes to npm
- Docker job builds multi-arch images and pushes to Docker Hub and GHCR (runs in parallel with Publish)
Docker Publishing
Docker images are published alongside npm packages on every release.
| Registry | Image |
|---|---|
| Docker Hub | ahoowang/godex |
| GitHub Container Registry | ghcr.io/ahoo-wang/godex |
Images are tagged with semantic versioning:
ahoowang/godex:X.Y.Z— exact versionahoowang/godex:X.Y— latest minorahoowang/godex:X— latest majorahoowang/godex:latest— latest release
Supported platforms: linux/amd64, linux/arm64.
Dockerfile
The Dockerfile uses a multi-stage build:
- Build stage — Uses
oven/bunto compile a standalone binary withbun build --compile - Runtime stage —
debian:bookworm-slimwith just the binary andca-certificates
Configuration
| Build Arg | Default | Description |
|---|---|---|
VERSION | 0.0.0 | Release version injected into the binary |
| Repository Variable | Required | Description |
|---|---|---|
DOCKERHUB_IMAGE | No | Docker Hub org/username. Falls back to github.repository_owner |
| Repository Secret | Required | Description |
|---|---|---|
DOCKERHUB_USERNAME | If DOCKERHUB_IMAGE is set | Docker Hub login username |
DOCKERHUB_TOKEN | If DOCKERHUB_IMAGE is set | Docker Hub access token |
When DOCKERHUB_IMAGE is not set, only GHCR publishing is active.