Skip to content

Commit 7ce1d1a

Browse files
authored
feat: action doc action (#1)
* feat: action doc action * chore(ci): Updating dist
1 parent 8c36dc5 commit 7ce1d1a

23 files changed

Lines changed: 21294 additions & 0 deletions

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
lib/
3+
node_modules/
4+
jest.config.js

.eslintrc.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"plugins": ["jest", "@typescript-eslint"],
3+
"extends": ["plugin:github/recommended"],
4+
"parser": "@typescript-eslint/parser",
5+
"parserOptions": {
6+
"ecmaVersion": 9,
7+
"sourceType": "module",
8+
"project": "./tsconfig.json"
9+
},
10+
"rules": {
11+
"eslint-comments/no-use": "off",
12+
"import/no-namespace": "off",
13+
"no-unused-vars": "off",
14+
"@typescript-eslint/no-unused-vars": "error",
15+
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
16+
"@typescript-eslint/no-require-imports": "error",
17+
"@typescript-eslint/array-type": "error",
18+
"@typescript-eslint/await-thenable": "error",
19+
"@typescript-eslint/ban-ts-comment": "error",
20+
"camelcase": "off",
21+
"@typescript-eslint/consistent-type-assertions": "error",
22+
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
23+
"@typescript-eslint/func-call-spacing": ["error", "never"],
24+
"@typescript-eslint/no-array-constructor": "error",
25+
"@typescript-eslint/no-empty-interface": "error",
26+
"@typescript-eslint/no-explicit-any": "error",
27+
"@typescript-eslint/no-extraneous-class": "error",
28+
"@typescript-eslint/no-for-in-array": "error",
29+
"@typescript-eslint/no-inferrable-types": "error",
30+
"@typescript-eslint/no-misused-new": "error",
31+
"@typescript-eslint/no-namespace": "error",
32+
"@typescript-eslint/no-non-null-assertion": "warn",
33+
"@typescript-eslint/no-unnecessary-qualifier": "error",
34+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
35+
"@typescript-eslint/no-useless-constructor": "error",
36+
"@typescript-eslint/no-var-requires": "error",
37+
"@typescript-eslint/prefer-for-of": "warn",
38+
"@typescript-eslint/prefer-function-type": "warn",
39+
"@typescript-eslint/prefer-includes": "error",
40+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
41+
"@typescript-eslint/promise-function-async": "error",
42+
"@typescript-eslint/require-array-sort-compare": "error",
43+
"@typescript-eslint/restrict-plus-operands": "error",
44+
"@typescript-eslint/type-annotation-spacing": "error",
45+
"@typescript-eslint/unbound-method": "error"
46+
},
47+
"env": {
48+
"node": true,
49+
"es6": true,
50+
"jest/globals": true
51+
}
52+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** -diff linguist-generated=true

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm
4+
- package-ecosystem: 'npm'
5+
# Look for `package.json` and `lock` files in the `root` directory
6+
directory: '/'
7+
# Check the npm registry for updates every day (weekdays)
8+
schedule:
9+
interval: 'daily'

.github/workflows/ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: 'CI'
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
pull_request:
8+
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: ["12", "14"]
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- uses: actions/setup-node@v2
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- name: Install dependencies
24+
run: yarn install
25+
26+
- name: Check format and lint
27+
run: yarn run format-check && yarn lint
28+
29+
- name: Build and package
30+
run: yarn build && yarn run package
31+
32+
- name: Update docs
33+
uses: './'
34+
- run: cat README.md
35+
36+
- name: Check for modified files
37+
id: changes
38+
run: |
39+
echo "::set-output name=files::$(git ls-files -m)"
40+
echo "::set-output name=count::$(git ls-files -m | wc -l)"
41+
42+
- uses: actions/github-script@v3.1.0
43+
if: github.event_name == 'pull_request' && steps.changes.outputs.count != 0
44+
with:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
script: |
47+
const output = `#### Changes detected
48+
Please verify you have updated the files below.
49+
50+
<details><summary>The following files are changed during the build</summary>
51+
52+
\`\`\`${{ steps.changes.outputs.files }}\`\`\`
53+
54+
</details>
55+
56+
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Workflow: \`${{ github.workflow }}\`*`;
57+
58+
github.issues.createComment({
59+
issue_number: context.issue.number,
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
body: output
63+
})
64+
- name: Update dist in the repository
65+
if: github.event_name != 'pull_request' && matrix.node-version == 12
66+
uses: stefanzweifel/git-auto-commit-action@v4.8.0
67+
with:
68+
commit_message: "chore(ci): Updating dist"
69+
file_pattern: dist/*
70+
- name: Update readme in the repository
71+
if: github.event_name != 'pull_request' && matrix.node-version == 12
72+
uses: stefanzweifel/git-auto-commit-action@v4.8.0
73+
with:
74+
commit_message: "chore(ci): Updating dist"
75+
file_pattern: README.md
76+
77+
- name: Release
78+
if:
79+
contains('
80+
refs/heads/main
81+
', github.ref) && matrix.node-version == 12
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
run: yarn release

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v12

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.prettierrc.json

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

.releaserc.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
branches:
3+
- "main"
4+
- name: "develop"
5+
prerelease: true
6+
7+
tagFormat: v${version}
8+
9+
plugins:
10+
- "@semantic-release/commit-analyzer"
11+
- "@semantic-release/release-notes-generator"
12+
- "@semantic-release/exec"
13+
- "@semantic-release/changelog"
14+
- "@semantic-release/git"
15+
- "@semantic-release/github"
16+
17+
verifyConditions:
18+
- '@semantic-release/git'
19+
analyzeCommits:
20+
- path: "@semantic-release/commit-analyzer"
21+
preset: "conventionalcommits"
22+
23+
generateNotes:
24+
- path: "@semantic-release/release-notes-generator"
25+
preset: "conventionalcommits"
26+
27+
prepare:
28+
- path: "@semantic-release/changelog"
29+
changelogFile: "CHANGELOG.md"
30+
31+
- path: "@semantic-release/git"
32+
assets: "CHANGELOG.md"
33+
34+
publish:
35+
- path: "@semantic-release/github"
36+
assets: "CHANGELOG.md"

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @npalm

0 commit comments

Comments
 (0)