Skip to content

Commit

Permalink
Chore: setup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
pustovitDmytro committed Jul 9, 2022
1 parent 913476c commit a7475d0
Show file tree
Hide file tree
Showing 11 changed files with 5,172 additions and 894 deletions.
29 changes: 11 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ aliases:
- &coverage
name: Test Coverage
command: npm run test:coverage -- --reporter mocha-junit-reporter --reporter-options mochaFile=reports/test-results/mocha/test-results.xml
- &lint
- &lint-js
name: JavaScript Linter
command: npm run test:lint -- --format junit --output-file ./reports/test-results/eslint/eslint.xml
command: npm run lint:js -- --format junit --output-file ./reports/test-results/eslint/eslint.xml
- &build-firefox
name: Build Firefox
command: npm run build:firefox
- &debt
name: Technical Debt
command: npm run test:debt
- &test-package
name: Test packed app
command: npm run test:package
- &security
name: Validate dependencies
command: npm run test:security
Expand All @@ -58,7 +58,6 @@ aliases:
paths:
- ~/.npm
- node_modules
- lib

version: 2.1
debug: true
Expand Down Expand Up @@ -113,7 +112,11 @@ jobs:
- checkout
- restore_cache:
<<: *cache-defaults
- run: *lint
- run: *lint-js
- run: *build-firefox
- run:
name: Lint Firefox build
command: npm run lint:firefox
- store_test_results:
path: reports
test-leaks:
Expand All @@ -138,13 +141,6 @@ jobs:
- run: *debt
- store_artifacts:
path: reports
test-package:
<<: *defaults
steps:
- checkout
- restore_cache:
<<: *cache-defaults
- run: *test-package
deploy:
<<: *defaults
steps:
Expand All @@ -168,9 +164,6 @@ workflows:
- test-security:
requires:
- install
- test-package:
requires:
- install
- test-lint:
requires:
- install
Expand All @@ -187,7 +180,7 @@ workflows:
context: npm-packages
requires:
- test-coverage
- test-package
- test-lint
filters:
branches:
only: master
Expand Down
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
node_modules
src/lib/*
tests/sample/lib/*
10 changes: 9 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@
"$": "readonly",
"_": "readonly",
"document": "writable"
}
},
"overrides": [
{
"files": ["bin/*.js"],
"rules": {
"node/no-unpublished-import": 0
}
}
]
}
2 changes: 1 addition & 1 deletion .jscpd.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"threshold": 5,
"reporters": ["html", "console"],
"ignore": [],
"ignore": [ "src/**/index.html"] ,
"output": "./reports/jscpd",
"minLines": 3,
"minTokens": 30,
Expand Down
67 changes: 67 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"branches": ["master"],
"branch": "master",
"ci": false,
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@google/semantic-release-replace-plugin",
{
"replacements": [
{
"files": ["src/manifest.json", "package.json"],
"from": "\"version\":\\s*\".*\"",
"to": "\"version\": \"${nextRelease.version}\""
}
]
}
],
[
"@semantic-release/exec", {
"publishCmd": "./bin/sign-firefox.sh"
}
],
[
"@semantic-release/changelog", {
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git", {
"assets": ["README.md", "CHANGELOG.md", "package.json"],
"message": "Chore: (release) add version ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github", {
"assets": [
{ "path": "build/*.zip", "label": "Packed Extention" },
{ "path": "build/*.xpi", "label": "Signed Extention" }
]
}
],
[
"semantic-release-telegram", {
"chats": [ 238585617 ],
"telegra.ph" : {
"title" : "{name} v.{version}",
"message" : "<a href='{telegraph_url}'>Release Notes</a>",
"content" : "{release_notes}"
}
}
]
],
"preset": "eslint",
"releaseRules": [
{ "tag": "Fix", "release": "patch" },
{ "tag": "Update", "release": "minor" },
{ "tag": "New", "release": "minor" },
{ "tag": "Breaking", "release": "major" },
{ "tag": "Docs", "release": "patch" },
{ "tag": "Upgrade", "release": "patch" }
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES"]
}
}
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ install npm modules:

to assemble firefox build, run the following:

```npm run build:firefox```
```npm run build:firefox```

## External Dependencies:

* ```jquery 3.6.0```
* ```select2 4.0.13```
* ```underscore 1.13.4```
* ```underscore 1.13.4```
* ```backbone 1.4.1```
4 changes: 4 additions & 0 deletions bin/sign-firefox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

npm run build:firefox
npx web-ext sign -s build/firefox -a build -v --api-key $FIREFOX_API_KEY --api-secret $FIREFOX_SECRET_KEY
Loading

0 comments on commit a7475d0

Please sign in to comment.