Skip to content
This repository was archived by the owner on May 29, 2023. It is now read-only.

Commit f0b6568

Browse files
feat(rules): add new rule (#10)
Co-authored-by: semantic-release-bot <[email protected]>
1 parent 50d6794 commit f0b6568

14 files changed

Lines changed: 8883 additions & 1121 deletions

.github/workflows/release.yml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Release
22

33
on:
4+
# push:
5+
# branches:
6+
# - dev
47
pull_request:
58
types: [closed]
69
branches:
@@ -26,26 +29,16 @@ jobs:
2629
- name: Set up Node.js
2730
uses: actions/setup-node@v3
2831
with:
29-
node-version: "18.6.x"
32+
node-version: '18.6.x'
3033

3134
- name: Install dependencies
32-
run: npm install
35+
run: npm ci
3336

34-
- name: Bump version and tag
35-
id: tag_version
36-
uses: mathieudutour/[email protected]
37-
with:
38-
github_token: ${{ secrets.ACTION_TOKEN }}
39-
release_branches: main
40-
41-
# - name: Build for release
42-
# run: npm run build
37+
- name: Build
38+
run: npm run build
4339

44-
- name: Release
45-
uses: softprops/action-gh-release@v1
46-
with:
47-
draft: false
48-
prerelease: false
49-
tag_name: ${{ steps.tag_version.outputs.new_tag }}
50-
name: Release ${{ steps.tag_version.outputs.new_tag }}
51-
body: ${{ steps.tag_version.outputs.changelog }}
40+
- name: Run semantic-release
41+
env:
42+
GH_TOKEN: ${{ secrets.ACTION_TOKEN }}
43+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
run: npx semantic-release

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"trailingComma": "es5",
33
"tabWidth": 2,
44
"semi": true,
5-
"singleQuote": false
5+
"singleQuote": true
66
}

.releaserc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
[
7+
"@semantic-release/changelog",
8+
{
9+
"changelogFile": "docs/CHANGELOG.md"
10+
}
11+
],
12+
[
13+
"@semantic-release/npm",
14+
{
15+
"npmPublish": true,
16+
"tarballDir": "dist"
17+
}
18+
],
19+
"@semantic-release/github",
20+
[
21+
"@semantic-release/git",
22+
{
23+
"assets": ["package.json", "docs/CHANGELOG.md"],
24+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
25+
}
26+
]
27+
],
28+
"dryRun": false
29+
}

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@
55
### Classical
66

77
```md
8-
https:/cdn.jsdelivr.net/gh/onemoon/rule-sets/src/black-list/lp-private.classical.yaml
8+
https:/cdn.jsdelivr.net/gh/onemoon/rule-sets@latest/src/black-list/lp-private.classical.yaml
99
```
1010

1111
### Domain
1212

1313
```md
14-
https:/cdn.jsdelivr.net/gh/onemoon/rule-sets/src/black-list/lp-private.domain.yaml
15-
```
16-
17-
### Ipcidr
18-
19-
```md
20-
https:/cdn.jsdelivr.net/gh/onemoon/rule-sets/src/black-list/lp-private.ipcidr.yaml
14+
https:/cdn.jsdelivr.net/gh/onemoon/rule-sets@latest/src/black-list/lp-private.domain.yaml
2115
```
2216

2317
## Software

TO_DO.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
## Release
44

5-
1. [ ] Investigate GitHub action
6-
2. [ ] Auto-generated jsdelivr cdn links
7-
3. [ ] Automatically release and update change logs
5+
1. [x] Investigate GitHub action
6+
2. [x] generate jsdelivr cdn links by script
7+
3. [x] Automatically release and update change logs

cz.config.cjs

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,104 @@
11
// cz.config.js
22
/** @type {import('cz-git').CommitizenGitOptions} */
33
module.exports = {
4-
alias: { fd: "docs: fix typos" },
4+
alias: { fd: 'docs: fix typos' },
55
messages: {
66
type: "Select the type of change that you're committing:",
7-
scope: "Denote the SCOPE of this change (optional):",
8-
customScope: "Denote the SCOPE of this change:",
9-
subject: "Write a SHORT, IMPERATIVE tense description of the change:\n",
7+
scope: 'Denote the SCOPE of this change (optional):',
8+
customScope: 'Denote the SCOPE of this change:',
9+
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
1010
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
1111
breaking:
1212
'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',
1313
footerPrefixesSelect:
14-
"Select the ISSUES type of changeList by this change (optional):",
15-
customFooterPrefix: "Input ISSUES prefix:",
16-
footer: "List any ISSUES by this change. E.g.: #31, #34:\n",
17-
generatingByAI: "Generating your AI commit subject...",
18-
generatedSelectByAI: "Select suitable subject by AI generated:",
19-
confirmCommit: "Are you sure you want to proceed with the commit above?",
14+
'Select the ISSUES type of changeList by this change (optional):',
15+
customFooterPrefix: 'Input ISSUES prefix:',
16+
footer: 'List any ISSUES by this change. E.g.: #31, #34:\n',
17+
generatingByAI: 'Generating your AI commit subject...',
18+
generatedSelectByAI: 'Select suitable subject by AI generated:',
19+
confirmCommit: 'Are you sure you want to proceed with the commit above?',
2020
},
2121
types: [
22-
{ value: "feat", name: "feat: A new feature", emoji: ":sparkles:" },
23-
{ value: "fix", name: "fix: A bug fix", emoji: ":bug:" },
22+
{ value: 'feat', name: 'feat: A new feature', emoji: ':sparkles:' },
23+
{ value: 'fix', name: 'fix: A bug fix', emoji: ':bug:' },
2424
{
25-
value: "docs",
26-
name: "docs: Documentation only changes",
27-
emoji: ":memo:",
25+
value: 'docs',
26+
name: 'docs: Documentation only changes',
27+
emoji: ':memo:',
2828
},
2929
{
30-
value: "style",
31-
name: "style: Changes that do not affect the meaning of the code",
32-
emoji: ":lipstick:",
30+
value: 'style',
31+
name: 'style: Changes that do not affect the meaning of the code',
32+
emoji: ':lipstick:',
3333
},
3434
{
35-
value: "refactor",
36-
name: "refactor: A code change that neither fixes a bug nor adds a feature",
37-
emoji: ":recycle:",
35+
value: 'refactor',
36+
name: 'refactor: A code change that neither fixes a bug nor adds a feature',
37+
emoji: ':recycle:',
3838
},
3939
{
40-
value: "perf",
41-
name: "perf: A code change that improves performance",
42-
emoji: ":zap:",
40+
value: 'perf',
41+
name: 'perf: A code change that improves performance',
42+
emoji: ':zap:',
4343
},
4444
{
45-
value: "test",
46-
name: "test: Adding missing tests or correcting existing tests",
47-
emoji: ":white_check_mark:",
45+
value: 'test',
46+
name: 'test: Adding missing tests or correcting existing tests',
47+
emoji: ':white_check_mark:',
4848
},
4949
{
50-
value: "build",
51-
name: "build: Changes that affect the build system or external dependencies",
52-
emoji: ":package:",
50+
value: 'build',
51+
name: 'build: Changes that affect the build system or external dependencies',
52+
emoji: ':package:',
5353
},
5454
{
55-
value: "ci",
56-
name: "ci: Changes to our CI configuration files and scripts",
57-
emoji: ":ferris_wheel:",
55+
value: 'ci',
56+
name: 'ci: Changes to our CI configuration files and scripts',
57+
emoji: ':ferris_wheel:',
5858
},
5959
{
60-
value: "chore",
60+
value: 'chore',
6161
name: "chore: Other changes that don't modify src or test files",
62-
emoji: ":hammer:",
62+
emoji: ':hammer:',
6363
},
6464
{
65-
value: "revert",
66-
name: "revert: Reverts a previous commit",
67-
emoji: ":rewind:",
65+
value: 'revert',
66+
name: 'revert: Reverts a previous commit',
67+
emoji: ':rewind:',
6868
},
6969
],
7070
useEmoji: false,
71-
emojiAlign: "center",
71+
emojiAlign: 'center',
7272
useAI: false,
7373
aiNumber: 1,
74-
themeColorCode: "",
75-
scopes: ["rules"],
74+
themeColorCode: '',
75+
scopes: ['rules', 'release', 'deps'],
7676
allowCustomScopes: true,
7777
allowEmptyScopes: true,
78-
customScopesAlign: "bottom",
79-
customScopesAlias: "custom",
80-
emptyScopesAlias: "empty",
78+
customScopesAlign: 'bottom',
79+
customScopesAlias: 'custom',
80+
emptyScopesAlias: 'empty',
8181
upperCaseSubject: false,
8282
markBreakingChangeMode: false,
83-
allowBreakingChanges: ["feat", "fix"],
83+
allowBreakingChanges: ['feat', 'fix'],
8484
breaklineNumber: 100,
85-
breaklineChar: "|",
85+
breaklineChar: '|',
8686
skipQuestions: [],
8787
issuePrefixes: [
88-
{ value: "closed", name: "closed: ISSUES has been processed" },
88+
{ value: 'closed', name: 'closed: ISSUES has been processed' },
8989
],
90-
customIssuePrefixAlign: "top",
91-
emptyIssuePrefixAlias: "skip",
92-
customIssuePrefixAlias: "custom",
90+
customIssuePrefixAlign: 'top',
91+
emptyIssuePrefixAlias: 'skip',
92+
customIssuePrefixAlias: 'custom',
9393
allowCustomIssuePrefix: true,
9494
allowEmptyIssuePrefix: true,
9595
confirmColorize: true,
9696
maxHeaderLength: Infinity,
9797
maxSubjectLength: Infinity,
9898
minSubjectLength: 0,
9999
scopeOverrides: undefined,
100-
defaultBody: "",
101-
defaultIssues: "",
102-
defaultScope: "",
103-
defaultSubject: "",
100+
defaultBody: '',
101+
defaultIssues: '',
102+
defaultScope: '',
103+
defaultSubject: '',
104104
};

docs/CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# [0.3.0-dev.7](https://github.com/onemoon/rule-sets/compare/v0.3.0-dev.6...v0.3.0-dev.7) (2023-05-25)
2+
3+
4+
### Bug Fixes
5+
6+
* **release:** config of semantic-release/npm ([328d403](https://github.com/onemoon/rule-sets/commit/328d4034d06cb7b80de4d4353f6a7d98775298fe))
7+
8+
# [0.3.0-dev.6](https://github.com/onemoon/rule-sets/compare/v0.3.0-dev.5...v0.3.0-dev.6) (2023-05-25)
9+
10+
11+
### Bug Fixes
12+
13+
* **release:** release error caused by empty file ([740bf0e](https://github.com/onemoon/rule-sets/commit/740bf0ea590bc822d269d08518109efdcd1fd597))
14+
15+
# [0.3.0-dev.5](https://github.com/onemoon/rule-sets/compare/v0.3.0-dev.4...v0.3.0-dev.5) (2023-05-25)
16+
17+
18+
### Bug Fixes
19+
20+
* **release:** assets of @semantic-release/github ([03296e8](https://github.com/onemoon/rule-sets/commit/03296e8e8d0b11ea984cfeec019284f6df375828))
21+
22+
# [0.3.0-dev.4](https://github.com/onemoon/rule-sets/compare/v0.3.0-dev.3...v0.3.0-dev.4) (2023-05-25)
23+
24+
25+
### Bug Fixes
26+
27+
* **release:** error of release config ([53c764f](https://github.com/onemoon/rule-sets/commit/53c764fc8d923c01a3d3415d0904aade312b65b8))
28+
29+
# [0.3.0-dev.3](https://github.com/onemoon/rule-sets/compare/v0.3.0-dev.2...v0.3.0-dev.3) (2023-05-25)
30+
31+
32+
### Bug Fixes
33+
34+
* **deps:** dependencies error ([d4ca52f](https://github.com/onemoon/rule-sets/commit/d4ca52f2eb6b0a95bed383c1acf479cc59af1839))
35+
* **deps:** dependencies error ([f637f6e](https://github.com/onemoon/rule-sets/commit/f637f6ecff1339c1db60386d20266960555593d5))

gulpfile.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import gulp from 'gulp';
2+
import { build as buildSets, clean } from './scripts/build.js';
3+
4+
const { task, series } = gulp;
5+
6+
task('build', series(clean, buildSets));

0 commit comments

Comments
 (0)