Skip to content

Commit

Permalink
chore: setup release
Browse files Browse the repository at this point in the history
  • Loading branch information
josephgodwinkimani committed Oct 17, 2024
1 parent fada9a7 commit f2800d1
Show file tree
Hide file tree
Showing 6 changed files with 2,084 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
😀 Wonderful! Thank you for opening a pull request.
Please fill in the information below to expedite the review
and (hopefully) merge of your change.
-->

### Description of change

<!--
Please be clear and concise what the change is intended to do,
why this change is needed, and how you've verified that it
corrects what you intended.
In some cases it may be helpful to include the current behavior
and the new behavior.
If the change is related to an open issue, you can link it here.
If you include `Fixes #0000` (replacing `0000` with the issue number)
when this is merged it will automatically mark the issue as fixed and
close it.
-->

### Pull-Request Checklist

<!--
Please make sure to review and check all of the following.
If an item is not applicable, you can add "N/A" to the end.
-->

- [ ] Code is up-to-date with the `main` branch
- [ ] `npm run lint` passes with this change
- [ ] `npm run test` passes with this change
- [ ] This pull request links relevant issues as `Fixes #0000`
- [ ] There are new or updated unit tests validating the change
- [ ] Documentation has been updated to reflect this change
- [ ] The new commits follow conventions outlined in the [conventional commit spec](https://www.conventionalcommits.org/en/v1.0.0/)

<!--
🎉 Thank you for contributing!
-->
7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Pull Request

on: [pull_request]

jobs:
build:
uses: ryansonshine/ryansonshine/.github/workflows/pr.yml@main
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
on:
workflow_call:
secrets:
NPM_TOKEN:
required: true

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ export class AppService {
- [nestjs](https://nestjs.com)
- [mpesapay](https://www.npmjs.com/package/mpesapay)

## Contributing

Thanks to everyone who has contributed to this project so far.

<a href="https://github.com/josephgodwinkimani/nestjs-mpesa/graphs/contributors">
<img src="https://contrib.rocks/image?repo=josephgodwinkimani/nestjs-mpesa" />
</a>

## License

[MIT](./LICENSE)
55 changes: 55 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@
"build": "rimraf lib && tsc --project tsconfig.build.json",
"format": "sort-package-json && prettier --write \"src/**/*.ts\" ",
"prepare": "node .husky/install.mjs",
"semantic-release": "semantic-release",
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watch"
},
"lint-staged": {
"*.{ts,json,md}": "pnpm run format"
},
"config": {
"commitizen": {
"path": "./node_modules/@ryansonshine/cz-conventional-changelog"
}
},
"prettier": {
"printWidth": 120,
"semi": true,
Expand All @@ -44,6 +50,51 @@
"trailingComma": "all",
"useTabs": false
},
"release": {
"branches": [
"main"
],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"type": "build",
"scope": "deps",
"release": "patch"
}
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "build",
"section": "Dependencies and Other Build Updates",
"hidden": false
}
]
}
}
],
"@semantic-release/npm",
"@semantic-release/github"
]
},
"jest": {
"coverageDirectory": "./coverage",
"moduleFileExtensions": [
Expand All @@ -67,14 +118,18 @@
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@ryansonshine/commitizen": "^4.2.8",
"@ryansonshine/cz-conventional-changelog": "^3.3.4",
"@types/jest": "^29.5.2",
"@types/node": "^20.3.1",
"conventional-changelog-conventionalcommits": "^8.0.0",
"husky": "^9.1.6",
"jest": "^29.5.0",
"lint-staged": "^15.2.10",
"prettier": "^3.0.0",
"rimraf": "5.0.7",
"rxjs": "^7.8.1",
"semantic-release": "^24.1.2",
"sort-package-json": "^2.8.0",
"ts-jest": "29.1.4",
"typescript": "5.3.3"
Expand Down
Loading

0 comments on commit f2800d1

Please sign in to comment.