You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check if CI has completed successfully for this commit
38
+
RESULT=$(gh run list --commit ${{ github.sha }} --status success --json conclusion,workflowName | jq '.[]|select(.workflowName == "Install and test AVA")')
39
+
if [ -z "$RESULT" ]; then
40
+
echo "CI has not completed successfully for this commit"
41
+
exit 1
42
+
fi
43
+
echo "All CI checks have passed!"
44
+
env:
45
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46
+
47
+
- name: Verify tag matches package.json version
48
+
run: |
49
+
PACKAGE_VERSION=$(jq -r '.version' package.json)
50
+
TAG_VERSION=${RELEASE_TAG#v}
51
+
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then
52
+
echo "Package version ($PACKAGE_VERSION) does not match tag version ($TAG_VERSION)"
Copy file name to clipboardExpand all lines: maintaining.md
+19-14Lines changed: 19 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,36 @@
7
7
## Testing
8
8
9
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.
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.
12
14
13
15
## CI
14
16
15
-
* Tests sometimes fail on Windows. Review the errors carefully.
16
-
* At least one Windows job must pass.
17
-
* All other jobs must pass.
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.
18
20
19
21
## Updating dependencies
20
22
21
23
* 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.
24
+
* TypeScript dependency changes require CI changes to ensure backwards compatibility, see below.
23
25
* Open a PR with the updates and only merge when CI passes (see the previous section).
24
26
25
27
## Updating TypeScript
26
28
27
29
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.
28
30
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.
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.
30
32
31
33
Speaking of, using newer TypeScript features could be considered a breaking change. This needs to be assessed on a case-by-case basis.
32
34
33
35
## Pull requests
34
36
35
37
* New features should come with tests and documentation.
36
38
* Ensure the [contributing guidelines](.github/CONTRIBUTING.md) are followed.
37
-
*Squash commits when merging.
39
+
*Usually we squash commits when merging. Rebases may sometimes be appropriate.
38
40
39
41
## Experiments
40
42
@@ -43,9 +45,12 @@ Speaking of, using newer TypeScript features could be considered a breaking chan
43
45
44
46
## Release process
45
47
46
-
* Update dependencies (see the previous section).
47
-
* If [necessary](docs/support-statement.md), update the `engines` field in `package.json`.
48
-
* Remove unsupported (or soon to be) Node.js versions.
49
-
* When doing a major version bump, make sure to require the latest releases of each supported Node.js version.
50
-
* Publish a new version using [`np`](https://github.com/sindresorhus/np) with a version number according to [SemVer](https://semver.org).
51
-
* Write a [release note](https://github.com/avajs/ava/releases/new) following the style of previous release notes.
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.
51
+
52
+
### Setup Requirements
53
+
54
+
For the automated workflows to work, the following secrets must be configured in the repository:
55
+
56
+
-`NPM_TOKEN`: An npm automation token with publish permissions to the AVA package, within the `npm` environment
0 commit comments