Skip to content

Commit fda6934

Browse files
committed
Update instructions
1 parent 9841623 commit fda6934

File tree

1 file changed

+38
-22
lines changed

1 file changed

+38
-22
lines changed

maintaining.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,67 @@
66

77
## Testing
88

9-
* `npm test`: Lint the code and run the entire test suite with coverage.
10-
* `npx test-ava`: Run self-hosted tests from `test/`. Wraps a stable version of AVA.
11-
* `npx tap`: Run legacy tests from `test-tap/`.
12-
13-
Note that in CI we only run linting with the Node.js version set in the `package.json` file under the `"volta"` key.
9+
- `npm test`: Lint the code and run the entire test suite with coverage.
10+
- `npx tap test-tap/fork.js --bail`: Run a specific test file and bail on the first failure (useful when hunting bugs).
11+
- `npx test-ava test/{file}.js`: Run self-hosted tests.
1412

1513
## CI
1614

17-
We test across Linux, macOS and Windows, across all supported Node.js versions. The occasional failure in a specific environment is to be expected. If jobs fail, review carefully.
18-
19-
TypeScript jobs should all pass.
15+
- Tests sometimes fail on Windows. Review the errors carefully.
16+
- At least one Windows job must pass.
17+
- All other jobs must pass.
2018

2119
## Updating dependencies
2220

23-
* Make sure new dependency versions are compatible with our supported Node.js versions.
24-
* TypeScript dependency changes require CI changes to ensure backwards compatibility, see below.
25-
* Open a PR with the updates and only merge when CI passes (see the previous section).
21+
- Make sure new dependency versions are compatible with our supported Node.js versions.
22+
- Leave the TypeScript dependency as it is, to avoid accidental breakage.
23+
- Open a PR with the updates and only merge when CI passes (see the previous section).
2624

2725
## Updating TypeScript
2826

2927
TypeScript itself does not follow SemVer. Consequently we may have to make changes to the type definition that, technically, are breaking changes for users with an older TypeScript version. That's OK, but we should be aware.
3028

31-
When updating the TypeScript dependency, *also* add it to the CI workflow. This enables us to do typechecking with previous TypeScript versions and avoid unintentional breakage. For instance we won't accidentally rely on newer TypeScript features.
29+
Only update the TypeScript dependency when truly necessary. This helps avoid accidental breakage. For instance we won't accidentally rely on newer TypeScript features.
3230

3331
Speaking of, using newer TypeScript features could be considered a breaking change. This needs to be assessed on a case-by-case basis.
3432

3533
## Pull requests
3634

37-
* New features should come with tests and documentation.
38-
* Ensure the [contributing guidelines](.github/CONTRIBUTING.md) are followed.
39-
* Usually we squash commits when merging. Rebases may sometimes be appropriate.
35+
- New features should come with tests and documentation.
36+
- Ensure the [contributing guidelines](.github/CONTRIBUTING.md) are followed.
37+
- Squash commits when merging.
4038

4139
## Experiments
4240

43-
* Implement breaking changes as an experiment first, requiring opt-in.
44-
* Ship new features early by treating them as an experiment, requiring opt-in.
41+
- Implement breaking changes as an experiment first, requiring opt-in.
42+
- Ship new features early by treating them as an experiment, requiring opt-in.
4543

4644
## Release process
4745

48-
* Use `npm version` with the correct increment and push the resulting tag and `main` branch.
49-
* CI will run against the tag. Wait for this to complete.
50-
* Approve the Release workflow within GitHub. The workflow includes npm provenance for enhanced security and supply chain transparency.
46+
1. In the `main` branch, use `npm version` with the correct increment.
47+
1. Push the resulting tag (`git push --tags`).
48+
1. Wait for minimal CI checks to pass and push the `main` branch.
49+
1. Wait for full CI run to complete on the tag.
50+
1. The *Release* workflow will automatically run and publish to npm with provenance. It will also create a draft GitHub release.
51+
1. Review and publish the [draft GitHub release](https://github.com/avajs/ava/releases).
52+
53+
The *Release* workflow includes several safety checks:
54+
55+
- Validates the tag version matches `package.json`
56+
- Verifies the tagged commit is included in the `main` branch
57+
- Confirms CI has passed for the commit
58+
59+
### Manual Release
60+
61+
If CI fails for the tag and you're confident this is not due to a fault in the release, you can manually trigger the *Release* workflow:
62+
63+
1. Go to the [*Release* workflow](https://github.com/avajs/ava/actions/workflows/release.yml)
64+
1. Click "Run workflow"
65+
1. Enter the release tag (e.g., `v1.2.3`)
66+
1. Optionally check "Skip CI status check"
5167

5268
### Setup Requirements
5369

54-
For the automated workflows to work, the following secrets must be configured in the repository:
70+
For the Release workflow to work, the `NPM_TOKEN` must be configured in the [`npm` environment](https://github.com/avajs/ava/settings/environments/7070437878/edit#environment-secrets).
5571

56-
- `NPM_TOKEN`: An npm automation token with publish permissions to the AVA package, within the `npm` environment
72+
This must be a granular automation token which can publish the AVA package. It must be set to expire after no more than 90 days.

0 commit comments

Comments
 (0)