GitHub Actions CI/CD
March 25, 2026 ยท View on GitHub
This directory contains GitHub Actions workflows for continuous integration, testing, and automated publishing.
Workflows
PR Tests & Build Verification (pr-tests.yml)
Automatically runs on:
- Pull requests to
masterormainbranches - Pushes to
masterormainbranches
Jobs
-
Test Matrix (
test)- Tests across Node.js versions: 20.x, 22.x, 24.x
- Includes Java 17 and PlantUML for diagram generation support
- Steps:
- Checkout code
- Setup Node.js with npm caching
- Setup Java (Temurin distribution)
- Install PlantUML and Graphviz
- Install dependencies with
npm ci - Run linting
- Run tests with coverage
- Build project - verify the package builds successfully
- Verify build artifacts - ensure critical output files exist
- Archive build artifacts (Node 22.x only)
- Upload coverage to Codecov (Node 22.x only)
-
Lint Check (
lint-only)- Runs ESLint on the codebase
- Checks code formatting with Prettier
- Fast-fail for code quality issues
Publish to NPM (publish.yml)
Automatically runs on:
- Pushes to
masterormainbranches (typically after PR merge)
Uses npm Trusted Publishing (OIDC) - no NPM_TOKEN secret needed.
Jobs
-
Test (
test)- Tests across Node.js versions: 20.x, 22.x, 24.x
- Runs full test suite including linting
- Must pass before publishing (fail-fast)
-
Publish to NPM (
publish)- Runs only if all tests pass
- Uses Node.js 22.x for publishing
- Uses OIDC Trusted Publishing (no token secrets required)
- Steps:
- Build project
- Check if version exists - queries npm registry
- Publish to npm - only if version is new (
npm publish --provenance --access public) - Create Git tag - tags release with version number
- Skip publishing - if version already exists (no-op)
Environment Requirements
- Node.js: 20.x, 22.x, 24.x (tests run on all versions)
- Java: 17 (Temurin distribution)
- PlantUML: Latest stable version
- Graphviz: Required for PlantUML diagram rendering
Secrets
CODECOV_TOKEN (Optional)
Optional for coverage reporting. Public repositories work without it.
Trusted Publishing (npm)
Publishing uses OIDC-based Trusted Publishing configured on npmjs.com.
No NPM_TOKEN secret is needed. The workflow requires permissions: id-token: write.
To set up Trusted Publishing:
- Go to npmjs.com package settings
- Configure Trusted Publishing for
dyatko/arkitrepository - Specify the
publish.ymlworkflow
Publishing Flow
- Development: Create feature branch, make changes, open PR
- PR Review:
pr-tests.ymlruns automatically (tests + build verification) - Merge: Update version in
package.json, merge PR - Automated Publishing:
publish.ymltests, checks npm, publishes if version is new, creates git tag
Build Output
Starting from version 2.0.0, the dist/ folder is no longer committed to the repository:
- Why: Reduces repository size, keeps git history clean
- CI/CD: Build artifacts are generated automatically in workflows
- NPM: Published packages include
dist/(built duringnpm publish) - Local Development: Run
npm run buildto generatedist/locally