Skip to content

Commit ce10eaf

Browse files
committed
feat(semantic-release): add semantic-release to automate the npm package version and release notes
1 parent 7c9a156 commit ce10eaf

File tree

7 files changed

+9588
-2775
lines changed

7 files changed

+9588
-2775
lines changed

.github/workflows/changelogCheck.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/npmVersionCheck.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Semantic Release
2+
on:
3+
push:
4+
branches:
5+
- master # or main
6+
7+
permissions:
8+
contents: read # for checkout
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write # to be able to publish a GitHub release
16+
issues: write # to be able to comment on released issues
17+
pull-requests: write # to be able to comment on released pull requests
18+
id-token: write # to enable use of OIDC for npm provenance
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "lts/*"
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
# consider npm provenance, see https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md#npm-provenance
34+
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
35+
run: npm audit signatures
36+
37+
- name: Build
38+
run: npm run build
39+
40+
# Use npx semantic-release to determine the next version
41+
- name: Release
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
run: npx semantic-release

.github/workflows/tagAndPublish.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,33 @@ const App = () => {
5252

5353
You need to pass an object containing API endpoint callbacks as the `apiValue` prop of the ApiProvider as described in the [usage](#usage) section for the widget to work. [Here](./docs/APIDOCUMENTATION.md) is a more detailed list of the API endpoint callbacks.
5454

55-
## Developing
55+
## Development Set Up
5656

5757
1. Clone project
5858
2. Install `Node(with npm)`. See [package.json](/package.json) for current required versions
5959
3. Run `npm i`
60-
4. Make your code changes
60+
4. Make your code changes - [Follow Conventional Commits](#commit-message-requirements)
6161
5. Run `npm run build` to build the project
6262
6. [Link Project](#linking-for-development)
6363
7. Test your changes
64-
8. Update change log, translations, and documentation as needed
64+
8. Update translations and documentation as needed
6565
9. Open Pull Request
6666

67+
## Commit Message Requirements
68+
69+
_To make commits that trigger a package release, use `npx cz`, it will launch easy to follow commitizen prompts._
70+
71+
A new _MAJOR.MINOR.PATCH_ release will be generated if at least one of the following types are used, see [Conventional Commits Documentation](https://www.conventionalcommits.org/) for more specifics.
72+
* `fix:` -> PATCH bump
73+
* `feat:` -> MINOR bump
74+
75+
Major bump (any type with a footer of `BREAKING CHANGE:`)
76+
```
77+
<any_type>: <message>
78+
79+
BREAKING CHANGE: <description>
80+
```
81+
6782
## Linking for Development
6883

6984
For developing this package locally, we suggest you use npm link to connect your local version of the package to your client app using the package.

0 commit comments

Comments
 (0)