feat: new release test

This commit is contained in:
Brian Pooe 2023-07-14 18:40:03 +02:00
parent 6c11ff224b
commit 26033340b4
7 changed files with 6785 additions and 3 deletions

24
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: CI
on:
push:
branches:
- '*'
- '*/*'
- '**'
- '!main'
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- name: Install deps
run: npm ci
- name: Lint affected
run: npx nx affected -t lint
- name: Test affected
run: npx nx affected -t test --configuration=ci
- name: Build affected
run: npx nx affected -t build

21
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: RELEASE
on: [workflow_dispatch]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v3
- name: Install deps
run: npm ci
- name: Lint
run: npx nx run-many -t lint
- name: Test
run: npx nx run-many -t test --configuration=ci
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View file

@ -1,7 +1,7 @@
{
"name": "@devtools-bp/ns-paystack",
"description": "Powerful library that provides seamless integration with the Paystack payment gateway for your NestJS applications. You can easily handle payment transactions with minimal effort.",
"version": "0.0.0-semantic-release",
"version": "1.7.0",
"scripts": {
"test": "echo \"Error:no test specified\" && exit 1"
},
@ -33,5 +33,8 @@
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.0",
"@nestjs/config": "^2.3.2"
},
"publishConfig": {
"access": "public"
}
}

View file

@ -39,6 +39,12 @@
"codeCoverage": true
}
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "ns-paystack"
}
}
},
"tags": []

6681
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "@devtools-bp/source",
"version": "0.0.0",
"version": "1.7.0",
"license": "MIT",
"scripts": {
"start:api:demo": "nx serve ns-paystack-demo",
@ -31,11 +31,17 @@
"@nx/node": "16.2.1",
"@nx/webpack": "16.2.1",
"@nx/workspace": "16.2.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^11.0.4",
"@total-typescript/shoehorn": "^0.1.0",
"@types/jest": "^29.4.0",
"@types/node": "~18.7.1",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"conventional-changelog-conventionalcommits": "^6.1.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "~8.15.0",
"eslint-config-prettier": "8.1.0",
@ -45,7 +51,9 @@
"lint-staged": "^13.2.2",
"nx": "16.2.1",
"nx-cloud": "latest",
"nx-release": "^3.1.5",
"prettier": "^2.6.2",
"replace-json-property": "^1.9.0",
"ts-jest": "^29.1.0",
"ts-node": "10.9.1",
"typescript": "~5.0.2"

41
release.config.js Normal file
View file

@ -0,0 +1,41 @@
module.exports = {
branches: ['main'],
preset: 'conventionalcommits',
presetConfig: {
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'chore', section: 'Chores' },
{ type: 'docs', hidden: true },
{ type: 'style', hidden: true },
{ type: 'refactor', section: 'Refactoring' },
{ type: 'perf', hidden: true },
{ type: 'test', hidden: true }
]
},
releaseRules: [{ type: 'refactor', release: 'patch' }],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
[
'@semantic-release/changelog',
{
changelogFile: `./CHANGELOG.md`
}
],
[
'@semantic-release/exec',
{
prepareCmd: `VERSION=\${nextRelease.version} npx nx run-many -t release && VERSION=\${nextRelease.version} npx -p replace-json-property rjp ./package.json version \${nextRelease.version}`
}
],
[
'@semantic-release/git',
{
assets: [`libs/**/package.json`, `package.json`, `CHANGELOG.md`],
message:
'chore(release): -v${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
}
]
]
};