|
| 1 | +# Workflows |
| 2 | + |
| 3 | +This document describes the GitHub Actions workflows and common development procedures for promptopskit. |
| 4 | + |
| 5 | +## GitHub Actions |
| 6 | + |
| 7 | +### CI (`.github/workflows/ci.yml`) |
| 8 | + |
| 9 | +Runs on every push to `main` and on pull requests (ignoring docs/website/markdown changes). |
| 10 | + |
| 11 | +- Tests against Node 20 and 22 |
| 12 | +- Steps: `npm ci` → `lint` → `test` → `build` → `publint` → `attw` |
| 13 | + |
| 14 | +### Publish (`.github/workflows/publish.yml`) |
| 15 | + |
| 16 | +Runs automatically when a tag matching `v*` is pushed. |
| 17 | + |
| 18 | +- Steps: `npm ci` → `lint` → `test` → `build` → `publint` → `attw` → `npm publish --access public` |
| 19 | +- Publishes to npm using the repository's `NODE_AUTH_TOKEN` secret |
| 20 | + |
| 21 | +**Do not run `npm publish` locally.** The Action handles it. |
| 22 | + |
| 23 | +### Deploy Website (`.github/workflows/website.yml`) |
| 24 | + |
| 25 | +Runs when `website/` or `docs/` files change on `main`, or via manual dispatch. |
| 26 | + |
| 27 | +- Copies `docs/*.md` into `website/docs/` |
| 28 | +- Syncs the `website/` directory to S3 |
| 29 | +- Invalidates the CloudFront cache |
| 30 | + |
| 31 | +## Publishing a New Version |
| 32 | + |
| 33 | +1. Make sure you're on `main` with a clean working tree. |
| 34 | + |
| 35 | +2. Bump the version: |
| 36 | + ```sh |
| 37 | + npm version patch # bug fixes (0.1.1 → 0.1.2) |
| 38 | + npm version minor # new features (0.1.1 → 0.2.0) |
| 39 | + npm version major # breaking changes (0.1.1 → 1.0.0) |
| 40 | + ``` |
| 41 | + This updates `package.json`, creates a git commit, and creates a `v*` tag. |
| 42 | + |
| 43 | +3. Push the commit and tag: |
| 44 | + ```sh |
| 45 | + git push && git push --tags |
| 46 | + ``` |
| 47 | + |
| 48 | +4. The **Publish** Action triggers automatically, runs all checks, and publishes to npm. |
| 49 | + |
| 50 | +5. Monitor the run at https://github.com/PredictabilityAtScale/promptopskit/actions to confirm it succeeds. |
| 51 | + |
| 52 | +That's it — three commands: `npm version`, `git push`, `git push --tags`. |
0 commit comments