Skip to content

Commit 4bed21a

Browse files
authored
Merge pull request #30 from RonasIT/feat/setup-ci
feat: setup CI and add contributing guide
2 parents 90007ec + 15a6835 commit 4bed21a

File tree

5 files changed

+397
-4
lines changed

5 files changed

+397
-4
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "22"
19+
registry-url: "https://registry.npmjs.org/"
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Build package
25+
run: npm run build --if-present
26+
27+
- name: Publish to NPM
28+
run: npm run release
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/validate.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Validate
2+
3+
on:
4+
pull_request:
5+
branches: [main, master, development]
6+
push:
7+
branches: [main, master, development]
8+
9+
jobs:
10+
validate:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "22"
21+
cache: "npm"
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run linting
27+
run: npm run lint --if-present
28+
29+
- name: Run tests
30+
run: npm test --if-present
31+
32+
- name: Run build
33+
run: npm run build --if-present

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Contributing
2+
3+
This document provides guidelines for contributing to this project.
4+
5+
## Getting started
6+
7+
1. Fork or clone the repository
8+
2. Install dependencies: `npm install`
9+
10+
## Development workflow
11+
12+
1. **Create a feature branch** from `main`
13+
2. **Make your changes** following the [coding standards](#coding-standards)
14+
3. **Test your changes** thoroughly
15+
4. **Update documentation** if needed
16+
5. **Run code checks**: `lint` and `test` (if available)
17+
6. **Submit a pull request** with a clear description
18+
19+
## Coding standards
20+
21+
### Branch naming
22+
23+
Use descriptive branch names and follow [Conventional Branch](https://conventional-branch.github.io/) guidelines.
24+
25+
### Commit messages
26+
27+
Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format
28+
29+
### Code checks
30+
31+
Repository has pre-commit code style and correctness checks. You can run them manually using `lint` and `format` scripts.
32+
33+
## Releases
34+
35+
To create a new release:
36+
37+
1. **Bump the version**: Run `npm version {patch|minor|major}` to update the version number in `package.json` and create a Git commit and tag
38+
39+
- `patch`: Bug fixes (0.2.0 → 0.2.1)
40+
- `minor`: New features (0.2.0 → 0.3.0)
41+
- `major`: Breaking changes (0.2.0 → 1.0.0)
42+
43+
2. **Push changes**: Push the commit and tag to the repository:
44+
45+
```bash
46+
git push && git push --tags
47+
```
48+
49+
3. **Create GitHub release**: Go to the [GitHub Releases](../../releases) page and:
50+
51+
- Click "Create a new release"
52+
- Select the tag created in step 1
53+
- Add release notes describing the changes
54+
- Click "Publish release"
55+
56+
4. **Automatic npm publication**: Once the GitHub release is published, the package will be automatically published to npm via GitHub Actions workflow.
57+
58+
> **Note**: Make sure you have the `NPM_TOKEN` secret configured in your repository settings for the npm publication to work.

0 commit comments

Comments
 (0)