Skip to content

Commit 5d2b964

Browse files
authored
Merge pull request #4 from ikhokha/feature/cicd
update - cicd configs
2 parents 0f5018f + 312dee8 commit 5d2b964

File tree

11 files changed

+1782
-846
lines changed

11 files changed

+1782
-846
lines changed

.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"extends": ["plugin:@typescript-eslint/recommended", "prettier/@typescript-eslint", "plugin:prettier/recommended"],
4+
"parserOptions": {
5+
"ecmaVersion": 2018,
6+
"sourceType": "module"
7+
}
8+
}

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
target-branch: "main"
7+
schedule:
8+
interval: "monthly"
9+
10+
- package-ecosystem: "npm"
11+
directory: "/"
12+
target-branch: "main"
13+
schedule:
14+
interval: "monthly"

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Pull Request Details
2+
3+
## Select type of change
4+
5+
- [ ] New Feature
6+
- [ ] Documentation
7+
- [ ] Refactoring
8+
- [ ] HotFix
9+
- [ ] CICD

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test Package Build
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
env:
8+
GITHUB_PACKAGE_TOKEN: ${{ secrets.GHP_ACCESS_TOKEN}}
9+
NPM_ACCESS_TOKEN: ${{ secrets.GHP_ACCESS_TOKEN }}
10+
11+
jobs:
12+
build-pkg:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Setup node
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '18.x'
22+
23+
- name: Copying config files
24+
run: cp ./.npmrc ~/.npmrc
25+
shell: bash
26+
27+
- name: Install dependencies
28+
run: yarn install
29+
30+
# - name: Linting
31+
# run: yarn lint --format junit -o reports/junit/js-lint-results.xml
32+
33+
- name: Typechecking
34+
run: yarn typecheck
35+
36+
- name: Dry-run publish package
37+
run: npm publish --dry-run

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
env:
8+
GITHUB_PACKAGE_TOKEN: ${{ secrets.GHP_ACCESS_TOKEN}}
9+
NPM_ACCESS_TOKEN: ${{ secrets.GHP_ACCESS_TOKEN }}
10+
11+
jobs:
12+
publish-pkg:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Setup node
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '18.x'
22+
23+
- name: Copying config files
24+
run: cp ./.npmrc ~/.npmrc
25+
shell: bash
26+
27+
- name: Install dependencies
28+
run: yarn install
29+
30+
- name: Build
31+
run: yarn build
32+
33+
# - name: Linting
34+
# run: yarn lint --format junit -o reports/junit/js-lint-results.xml
35+
36+
- name: Typechecking
37+
run: yarn typecheck
38+
39+
- name: Publish npm pkg
40+
run: npm publish

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
@ikhokha:registry=https://npm.pkg.github.com
22
//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGE_TOKEN}
3-
//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}
3+
# //registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}

.prettierrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 130,
3+
"useTabs": true,
4+
"trailingComma": "all",
5+
"singleQuote": false,
6+
"semi": false,
7+
"endOfLine": "lf"
8+
}

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ikhokha/octet-buffer",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Lightweight wrapper around Node Buffer, providing streaming read/write for uint8 to unit32",
55
"author": "Simon Eumes <[email protected]>",
66
"contributors": [
@@ -23,6 +23,7 @@
2323
"scripts": {
2424
"build": "rm -rf ./dist && tsc -p tsconfig.json",
2525
"typecheck": "tsc --noEmit",
26+
"lint": "eslint src/**/*.ts --ext .ts",
2627
"test": "mocha src/**/*-Specs.ts"
2728
},
2829
"keywords": [
@@ -39,6 +40,12 @@
3940
"devDependencies": {
4041
"@types/chai": "^5.0.1",
4142
"@types/mocha": "^10.0.10",
43+
"eslint": "^6.4.0",
44+
"@typescript-eslint/eslint-plugin": "^2.3.2",
45+
"@typescript-eslint/parser": "^2.3.1",
46+
"eslint-config-prettier": "^6.3.0",
47+
"eslint-plugin-prettier": "^3.1.1",
48+
"prettier": "^1.18.2",
4249
"chai": "^5.1.2",
4350
"mocha": "^11.1.0",
4451
"tsx": "^4.19.2",

0 commit comments

Comments
 (0)