Skip to content
Merged
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
13 changes: 13 additions & 0 deletions .github/workflows/ipa-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ jobs:
version_changed=$(./.github/scripts/ipa_version_check.sh)
echo "Version changed? ${version_changed}"
echo "version_changed=${version_changed}" >> "${GITHUB_OUTPUT}"
- name: Check package-lock.json version
working-directory: tools/spectral/ipa
run: |
pkg_version=$(node -p "require('./package.json').version")
lock_version=$(node -p "require('./package-lock.json').version")
lock_root_version=$(node -p "require('./package-lock.json').packages[''].version")

if [[ "${lock_version}" != "${pkg_version}" ]] || [[ "${lock_root_version}" != "${pkg_version}" ]]; then
echo "Error: package-lock.json version (top-level: ${lock_version}, packages[\"\"]: ${lock_root_version}) does not match package.json version (${pkg_version})."
echo "Please run 'npm install --package-lock-only' from tools/spectral/ipa and commit the changes."
exit 1
fi

- name: Check Changelog
working-directory: tools/spectral/ipa
env:
Expand Down
3 changes: 2 additions & 1 deletion tools/spectral/ipa/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ npm run gen-ipa-docs

A new version of the IPA package will be released when the version in the package.json is changed. To release a new version:

- [ ] Ensure your branch is clean and you have no outstanding changes. Release PRs should only contain the updated changelog and edits to the package.json
- [ ] Ensure your branch is clean and you have no outstanding changes. Release PRs should only contain the updated changelog and edits to the package.json and package-lock.json
- [ ] Determine whether your update is major/minor/patch. We follow [semantic versioning](https://semver.org/) custom to the ruleset where:
- major (X.0.0) - Changes in behaviour to existing rules, breaking changes
- minor (0.X.0) - New rules or custom extensions
- patch (0.0.X) - Backwards-compatible bug fixes
- [ ] Update the version number in package.json
- [ ] Run `npm install --package-lock-only` from `tools/spectral/ipa` to sync the version in package-lock.json (it appears twice: top-level and under `packages[""]`) and commit the changes. CI fails if the lockfile version does not match package.json.
- [ ] Run `npm run gen-ipa-changelog` and commit the changes. The changelog must be updated alongside a new release.
- [ ] Open a PR and ensure the title is conventional and scoped to IPA (ie: `ci(ipa): release new version x.x.x`)

Expand Down
Loading