Skip to content

Commit

Permalink
Chore: setup semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovitDmytro committed Jul 10, 2022
1 parent b3b4176 commit 3e24329
Show file tree
Hide file tree
Showing 7 changed files with 241 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
!package-lock.json
!LICENSE.md
!CHANGELOG.md

!templates/*
8 changes: 4 additions & 4 deletions .nycrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
],
"report-dir": "./reports/coverage",
"temp-dir": "./reports/coverage",
"lines": 95,
"statements": 90,
"functions": 90,
"branches": 85,
"lines": 87,
"statements": 86,
"functions": 78,
"branches": 63,
"check-coverage": true
}
5 changes: 3 additions & 2 deletions .package-tester.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"copy": [
[ "tests/init.js", "tests-init.js" ],
[ "tests/test.env", ".env" ],
[ ".env.defaults", ".env.defaults" ]
[ ".env.defaults", ".env.defaults" ],
[ "templates", "templates" ]
],
"copyDefaultFiles": true,
"modules": [ "cls-hooked", "fs-extra", "uuid", "winston", "winston-array-transport" ]
"modules": [ "cls-hooked", "fs-extra", "uuid", "winston", "winston-array-transport", "supertest" ]
}
54 changes: 51 additions & 3 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,61 @@
}
],
[
"@semantic-release/npm",{
"tarballDir": "./"
"@google/semantic-release-replace-plugin",
{
"replacements": [
{
"files": ["package.json"],
"from": "\"version\":\\s*\".*\"",
"to": "\"version\": \"${nextRelease.version}\""
},
{
"files": ["docker/Admin.dockerfile", "docker/Worker.dockerfile"],
"from": "FROM pustovitdmytro/ianus-base:.*",
"to": "FROM pustovitdmytro/ianus-base:${nextRelease.version}"
}
]
}
],
[
"@codedependant/semantic-release-docker", {
"dockerTags": [ "latest", "{version}", "{major}", "{major}.{minor}" ],
"dockerImage": "ianus-base",
"dockerFile": "docker/Base.dockerfile",
"dockerProject": "pustovitdmytro",
"dockerArgs": {
"BUILD_DATE": "{now}",
"BUILD_VERSION": "{next.version}"
}
}
],
[
"@codedependant/semantic-release-docker", {
"dockerTags": [ "latest", "{version}", "{major}", "{major}.{minor}" ],
"dockerImage": "ianus-admin",
"dockerFile": "docker/Admin.dockerfile",
"dockerProject": "pustovitdmytro",
"dockerArgs": {
"BUILD_DATE": "{now}",
"BUILD_VERSION": "{next.version}"
}
}
],
[
"@codedependant/semantic-release-docker", {
"dockerTags": [ "latest", "{version}", "{major}", "{major}.{minor}" ],
"dockerImage": "ianus-worker",
"dockerFile": "docker/Worker.dockerfile",
"dockerProject": "pustovitdmytro",
"dockerArgs": {
"BUILD_DATE": "{now}",
"BUILD_VERSION": "{next.version}"
}
}
],
[
"@semantic-release/git", {
"assets": ["README.md", "CHANGELOG.md", "package.json"],
"assets": ["README.md", "CHANGELOG.md", "package.json", "docker/*.dockerfile"],
"message": "Chore: (release) add version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
Expand Down
178 changes: 178 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test:security": "npm audit --production && npm run test:lock",
"test:lint": "eslint src bin tests --no-error-on-unmatched-pattern",
"test:mocha": "mocha --config .mocharc.json 'tests/**/*test.js'",
"test:package": "npt test -c .package-tester.json",
"test:package": "npm run build:src && npt test -c .package-tester.json",
"test:coverage": "BUILD=0 MODE=test nyc mocha --config .mocharc.json 'tests/**/*test.js'",
"test:debt": "jscpd src --config .jscpd.json",
"test:lock": "lockfile-lint --path package-lock.json --validate-https --allowed-hosts npm",
Expand Down Expand Up @@ -43,8 +43,10 @@
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.16.11",
"@babel/runtime": "^7.16.7",
"@codedependant/semantic-release-docker": "^4.1.0",
"@commitlint/cli": "^16.1.0",
"@commitlint/lint": "^16.0.0",
"@google/semantic-release-replace-plugin": "^1.1.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"babel-plugin-module-resolver": "^4.1.0",
Expand Down
1 change: 0 additions & 1 deletion tests/workers/binanceP2PRequest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { load } from '../utils';
import { mockAPI as mockBinance, unMockAPI as unmockBinance } from '../mock/Binance';
import { mockAPI as mockTg, unMockAPI as unmockTg } from '../mock/Telegram';
import { Job } from '../mock/Job';
// import seedRepositories from '../mock/seeds/repositories.json';

const factory = new Test();
const handler = load('workers/binanceP2PRequest').default;
Expand Down

0 comments on commit 3e24329

Please sign in to comment.