Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Mirrors the root package.json scripts step for step: keep the two in
# correspondence when adding a check to either side.
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- run: npm ci

- run: npm run typecheck

- run: npm test

- run: npm run build

- name: Version lockstep
run: npm run check-version
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,31 @@ npm test
npm run build
```

Releases bump every package to one version, then publish them all:
Releases bump every package to one version, then publish them all. `npm version`
fans the bump out through `scripts/set-version.mjs` (workspace manifests, internal
ranges, embedded `VERSION` constants) and refreshes the lockfile. It also creates
a release commit and a `v<version>` tag, and refuses to run on a dirty tree, so
commit or stash first. Pass `-m` to keep the `chore(release): vX.Y.Z` commit
convention:

```sh
npm run set-version -- 0.2.0
npm version 0.2.0 -m 'chore(release): v%s'
npm run build
npm publish --workspaces
```

Add `--no-git-tag-version` to skip the commit and tag; the bump is then left
Comment thread
cb-jeeves marked this conversation as resolved.
staged for you to commit yourself.

To bump without `npm version`, run `npm run set-version -- 0.2.0` followed by
`npm install --package-lock-only`; `check-version` does not inspect the lockfile,
so a bare `set-version` leaves `package-lock.json` behind unnoticed.

`npm run check-version` verifies the lockstep without changing anything:
Comment thread
cb-jeeves marked this conversation as resolved.
every manifest on the root version, every internal dependency range at
`^<version>`, every embedded `VERSION` constant matching. CI runs it alongside
typecheck, test, and build on every pull request and push to `main`.

## Getting started (operators)

```sh
Expand Down
10 changes: 9 additions & 1 deletion okf-bundle/interfaces/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ between "millwright's own deployment is CDK" and "your workflows are not CDK".
```sh
npm install && npm run typecheck && npm test && npm run build

npm run set-version -- 0.2.0 # bump every package to one version
npm version 0.2.0 -m 'chore(release): v%s' # bump every package, commit, tag v0.2.0
npm run build
npm publish --workspaces
```

`npm run check-version` (`scripts/set-version.mjs --check`) asserts the lockstep without writing:
every manifest on the root version, every `@copperbox/millwright-*` range at `^<version>`, every
`src/version.ts` `VERSION` matching. `.github/workflows/ci.yml` runs typecheck, test, build, and
this check on pull requests and pushes to `main`. The root `version` lifecycle script fans an
`npm version` bump through `set-version.mjs` and refreshes the lockfile. `npm version` then
commits and tags `v<version>`, and it refuses to run on a dirty tree; `--no-git-tag-version`
leaves the bump staged without a commit or tag. Publishing stays manual.

## Related

- [Deployment construct](deployment.md) · [Run model](../schemas/run-model.md) for the
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "millwright",
"version": "0.6.3",
"version": "0.7.0",
Comment thread
cb-jeeves marked this conversation as resolved.
"private": true,
"description": "Millwright monorepo — polling-driven CI/CD in your own AWS account",
"license": "MIT",
Expand All @@ -11,7 +11,9 @@
"build": "npm run build --workspace @copperbox/millwright-state --workspace @copperbox/millwright-workflows --workspace @copperbox/millwright-cdk --workspace @copperbox/millwright-cli",
"typecheck": "npm run typecheck --workspaces",
"test": "vitest run",
"set-version": "node scripts/set-version.mjs"
"set-version": "node scripts/set-version.mjs",
"check-version": "node scripts/set-version.mjs --check",
"version": "node scripts/set-version.mjs && npm install --package-lock-only && git add -u package.json packages package-lock.json"
},
"devDependencies": {
"@types/node": "^22.10.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/millwright-cdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@copperbox/millwright-cdk",
"version": "0.6.2",
"version": "0.7.0",
"description": "The Millwright CDK construct — deploys the millwright control plane into your AWS account",
"license": "MIT",
"repository": {
Expand All @@ -23,9 +23,9 @@
"test": "vitest run"
},
"dependencies": {
"@copperbox/millwright-cli": "^0.6.2",
"@copperbox/millwright-state": "^0.6.2",
"@copperbox/millwright-workflows": "^0.6.2",
"@copperbox/millwright-cli": "^0.7.0",
"@copperbox/millwright-state": "^0.7.0",
"@copperbox/millwright-workflows": "^0.7.0",
"esbuild": "^0.28.0",
"ssh2": "^1.17.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/millwright-cdk/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Kept in lockstep with package.json by scripts/set-version.mjs — do not edit by hand.
export const VERSION = '0.6.2';
export const VERSION = '0.7.0';

/**
* Highest run-model schemaVersion this control plane accepts. Synth fails
Expand Down
22 changes: 0 additions & 22 deletions packages/millwright-cdk/test/millwright.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { Annotations, Match, Template } from 'aws-cdk-lib/assertions';
import * as iam from 'aws-cdk-lib/aws-iam';
import { describe, expect, it } from 'vitest';
import { Boundary, Millwright, MillwrightProps, SUPPORTED_SCHEMA_VERSION, VERSION } from '../src';
import cdkPkg from '../package.json';
import rootPkg from '../../../package.json';
import cliPkg from '../../millwright-cli/package.json';
import statePkg from '../../millwright-state/package.json';
import workflowsPkg from '../../millwright-workflows/package.json';
import { VERSION as CLI_VERSION } from '../../millwright-cli/src/version';

const BOUNDARY_ARN = 'arn:aws:iam::123456789012:policy/team-boundary';

Expand Down Expand Up @@ -166,19 +160,3 @@ describe('run executor wiring', () => {
expect(millwright.buildProject.projectName).toBe(millwright.runExecutor.buildProjectName);
});
});

describe('lockstep version', () => {
it('keeps the embedded VERSION constants in sync with their manifests', () => {
expect(VERSION).toBe(cdkPkg.version);
expect(CLI_VERSION).toBe(cliPkg.version);
});

it('keeps every workspace manifest on the root version', () => {
// A hand-edited bump that skips `npm run set-version` moves some subset
// of the five manifests; pinning all four workspaces to the root catches
// any divergence, not just the cdk one.
for (const pkg of [cdkPkg, cliPkg, statePkg, workflowsPkg]) {
expect(pkg.version, pkg.name).toBe(rootPkg.version);
}
});
});
6 changes: 3 additions & 3 deletions packages/millwright-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@copperbox/millwright-cli",
"version": "0.6.2",
"version": "0.7.0",
"description": "millwright CLI — operate a millwright deployment from operator and developer machines",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -33,8 +33,8 @@
"@aws-sdk/client-sfn": "^3.1108.0",
"@aws-sdk/client-ssm": "^3.700.0",
"@aws-sdk/lib-dynamodb": "^3.1108.0",
"@copperbox/millwright-state": "^0.6.2",
"@copperbox/millwright-workflows": "^0.6.2",
"@copperbox/millwright-state": "^0.7.0",
"@copperbox/millwright-workflows": "^0.7.0",
"commander": "^12.1.0",
"ssh2": "^1.17.0",
"typescript": "^5.7.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/millwright-cli/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Kept in lockstep with package.json by scripts/set-version.mjs — do not edit by hand.
export const VERSION = '0.6.2';
export const VERSION = '0.7.0';
2 changes: 1 addition & 1 deletion packages/millwright-state/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@copperbox/millwright-state",
"version": "0.6.2",
"version": "0.7.0",
"description": "Millwright's shared data-plane helpers — state/polling table item accessors, SSM config-plane paths, S3 layout",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/millwright-workflows/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@copperbox/millwright-workflows",
"version": "0.6.2",
"version": "0.7.0",
"description": "Millwright workflow definition library — the only install in watched repos",
"license": "MIT",
"repository": {
Expand Down
Loading
Loading