@anolilab/semantic-release-preset 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +54 -9
- package/lib/postinstall.js +22 -0
- package/package.json +25 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## @anolilab/semantic-release-preset [1.2.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@1.1.0...@anolilab/semantic-release-preset@1.2.0) (2021-12-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* updated [@commitlint](https://github.com/commitlint) and [@semantic-release](https://github.com/semantic-release) deps ([b331dd0](https://github.com/anolilab/javascript-style-guide/commit/b331dd0d14480590bbd7ceed2dba93c8164471fd))
|
|
7
|
+
|
|
8
|
+
## @anolilab/semantic-release-preset [1.1.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@1.0.3...@anolilab/semantic-release-preset@1.1.0) (2021-10-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* updated all deps ([0320055](https://github.com/anolilab/javascript-style-guide/commit/0320055caf8301a6c3bf06cff6ee58578b9ceae5))
|
|
14
|
+
|
|
15
|
+
### @anolilab/semantic-release-preset [1.0.3](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@1.0.2...@anolilab/semantic-release-preset@1.0.3) (2021-09-02)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* added funding to the package ([f90d18f](https://github.com/anolilab/javascript-style-guide/commit/f90d18f8347a4bdc395b1740c85ac74a4072297c))
|
|
21
|
+
|
|
22
|
+
### @anolilab/semantic-release-preset [1.0.2](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@1.0.1...@anolilab/semantic-release-preset@1.0.2) (2021-09-02)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* added commitizen ([f1c6032](https://github.com/anolilab/javascript-style-guide/commit/f1c6032c9110abbb09c06d4a19439208950ee451))
|
|
28
|
+
|
|
1
29
|
### @anolilab/semantic-release-preset [1.0.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/semantic-release-preset@1.0.0...@anolilab/semantic-release-preset@1.0.1) (2021-09-02)
|
|
2
30
|
|
|
3
31
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Semantic-release shareable configuration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Semantic-release shareable configuration to publish GitHub projects.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
<p>
|
|
9
|
+
<sup>
|
|
10
|
+
Daniel Bannert's open source work is supported by the community on <a href="https://github.com/sponsors/prisis">GitHub Sponsors</a>
|
|
11
|
+
</sup>
|
|
12
|
+
</p>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
4
16
|
|
|
5
17
|
## Install
|
|
6
18
|
|
|
@@ -28,7 +40,7 @@ This shareable configuration performs the following actions:
|
|
|
28
40
|
2. Generate changelog content ([@semantic-release/release-notes-generator][2])
|
|
29
41
|
3. Create or update a changelog file generated by step 2 ([@semantic-release/changelog][3])
|
|
30
42
|
4. Update the package version to the next release version
|
|
31
|
-
5. Commit release assets to the project
|
|
43
|
+
5. Commit release assets to the project’s git repository with the commit message chore(release): ${nextRelease.version} [skip ci] ${nextRelease.notes}.
|
|
32
44
|
6. Publish a npm release ([@semantic-release/npm][4]) (optional)
|
|
33
45
|
7. Publish a GitHub release and comment on released Pull Requests/Issues ([@semantic-release/github][4])
|
|
34
46
|
|
|
@@ -103,12 +115,21 @@ File content:
|
|
|
103
115
|
|
|
104
116
|
```
|
|
105
117
|
|
|
118
|
+
### Add [Commitizen](https://github.com/commitizen/cz-cli)
|
|
119
|
+
Add `cz` to your `package.json scripts`
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
"scripts": {
|
|
123
|
+
"commit": "cz"
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
106
127
|
### Environment Variables Configuration
|
|
107
128
|
|
|
108
129
|
Ensure that your CI configuration has the following environment variables set:
|
|
109
130
|
|
|
110
|
-
- GITHUB_TOKEN: [A GitHub personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
|
|
111
|
-
- NPM_TOKEN: [A npm personal access token](https://www.npmjs.com/settings
|
|
131
|
+
- GITHUB_TOKEN: [A GitHub personal access token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)
|
|
132
|
+
- NPM_TOKEN: [A npm personal access token](https://www.npmjs.com/settings)
|
|
112
133
|
|
|
113
134
|
You can test your config with a dry run:
|
|
114
135
|
|
|
@@ -116,9 +137,9 @@ You can test your config with a dry run:
|
|
|
116
137
|
npx semantic-release --dry-run
|
|
117
138
|
```
|
|
118
139
|
|
|
119
|
-
What you
|
|
140
|
+
What you’ll want to do next is configure a [GitHub workflow](https://docs.github.com/en/actions/quickstart) to run your tests and publish new versions automatically.
|
|
120
141
|
|
|
121
|
-
Here
|
|
142
|
+
Here’s an example workflow configuration that runs your tests and publishes a new version for new commits on `main` branch:
|
|
122
143
|
|
|
123
144
|
```yaml
|
|
124
145
|
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
|
@@ -231,13 +252,37 @@ jobs:
|
|
|
231
252
|
|
|
232
253
|
## Note on GitHub protected branches
|
|
233
254
|
|
|
234
|
-
If you
|
|
255
|
+
If you’re releasing a [GitHub protected branch](https://docs.github.com/en/github/administering-a-repository/defining-the-mergeability-of-pull-requests/about-protected-branches) you need to change the git committer to an owner/admin and allow repo admins to bypass the branch protection (make sure "include administrators" is disabled in the branch protection rules.)
|
|
235
256
|
|
|
236
257
|
If your repo is under an organisation, you can create a bot account and give it admin rights on the repo. If your repo is under a personal account, you have no choice to make the repo owner the commiter for the release.
|
|
237
258
|
|
|
238
259
|
Either way, you have to create a GitHub personal access token for the committer account and give it the "repo" access rights. Then set it to the GH_TOKEN secret in your GitHub repository.
|
|
239
260
|
|
|
240
|
-
> Note: GitHub secrets not shared with forks and pull requests, so no one that doesn
|
|
261
|
+
> Note: GitHub secrets not shared with forks and pull requests, so no one that doesn’t have write access to your repo can use of them.
|
|
262
|
+
|
|
263
|
+
## Supported Node.js Versions
|
|
264
|
+
|
|
265
|
+
Libraries in this ecosystem make the best effort to track
|
|
266
|
+
[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
|
|
267
|
+
post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
|
268
|
+
|
|
269
|
+
Contributing
|
|
270
|
+
------------
|
|
271
|
+
|
|
272
|
+
If you would like to help take a look at the [list of issues](https://github.com/anolilab/javascript-style-guide/issues) and check our [Contributing](.github/CONTRIBUTING.md) guild.
|
|
273
|
+
|
|
274
|
+
> **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
|
|
275
|
+
|
|
276
|
+
Credits
|
|
277
|
+
-------------
|
|
278
|
+
|
|
279
|
+
- [Daniel Bannert](https://github.com/prisis)
|
|
280
|
+
- [All Contributors](https://github.com/anolilab/javascript-style-guide/graphs/contributors)
|
|
281
|
+
|
|
282
|
+
License
|
|
283
|
+
-------------
|
|
284
|
+
|
|
285
|
+
The anolilab javascript-style-guide is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT)
|
|
241
286
|
|
|
242
287
|
[1]: https://github.com/semantic-release/commit-analyzer
|
|
243
288
|
[2]: https://github.com/semantic-release/release-notes-generator
|
package/lib/postinstall.js
CHANGED
|
@@ -69,10 +69,32 @@ const writeCommitlintConfig = () => {
|
|
|
69
69
|
return writeFileAsync(filePath, content, "utf-8");
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Writes .czrc if it doesn't exist. Warns if it exists.
|
|
74
|
+
*/
|
|
75
|
+
const writeCzrc = () => {
|
|
76
|
+
const filePath = join(projectPath, ".czrc");
|
|
77
|
+
|
|
78
|
+
if (existsSync(filePath)) {
|
|
79
|
+
console.warn(`⚠️ .czrc already exists;`);
|
|
80
|
+
|
|
81
|
+
return Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const content = `{
|
|
85
|
+
"path": "cz-conventional-changelog"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
return writeFileAsync(filePath, content, "utf-8");
|
|
91
|
+
};
|
|
92
|
+
|
|
72
93
|
(async () => {
|
|
73
94
|
try {
|
|
74
95
|
await writeReleaserc();
|
|
75
96
|
await writeCommitlintConfig();
|
|
97
|
+
await writeCzrc();
|
|
76
98
|
|
|
77
99
|
console.log("😎 Everything went well, have fun!");
|
|
78
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/semantic-release-preset",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Anolilab Coding Standard for semantic-release.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -13,12 +13,22 @@
|
|
|
13
13
|
"github",
|
|
14
14
|
"git"
|
|
15
15
|
],
|
|
16
|
-
"homepage": "
|
|
16
|
+
"homepage": "https://anolilab.com/nodejs/packages/semantic-release-preset",
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "https://github.com/anolilab/javascript-style-guide.git",
|
|
20
20
|
"directory": "packages/semantic-release-preset"
|
|
21
21
|
},
|
|
22
|
+
"funding": [
|
|
23
|
+
{
|
|
24
|
+
"type": "github",
|
|
25
|
+
"url": "https://github.com/sponsors/prisis"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "consulting",
|
|
29
|
+
"url": "https://anolilab.com/support"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
22
32
|
"license": "MIT",
|
|
23
33
|
"author": {
|
|
24
34
|
"name": "Daniel Bannert",
|
|
@@ -38,26 +48,26 @@
|
|
|
38
48
|
"postinstall": "node lib/postinstall.js"
|
|
39
49
|
},
|
|
40
50
|
"dependencies": {
|
|
41
|
-
"@commitlint/cli": "^
|
|
42
|
-
"@commitlint/config-conventional": "^
|
|
43
|
-
"@commitlint/core": "^
|
|
44
|
-
"@semantic-release/changelog": "^
|
|
45
|
-
"@semantic-release/commit-analyzer": "^
|
|
46
|
-
"@semantic-release/exec": "^
|
|
47
|
-
"@semantic-release/git": "^
|
|
48
|
-
"@semantic-release/github": "^
|
|
49
|
-
"@semantic-release/npm": "^
|
|
50
|
-
"@semantic-release/release-notes-generator": "^
|
|
51
|
+
"@commitlint/cli": "^15.0.0",
|
|
52
|
+
"@commitlint/config-conventional": "^15.0.0",
|
|
53
|
+
"@commitlint/core": "^15.0.0",
|
|
54
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
55
|
+
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
56
|
+
"@semantic-release/exec": "^6.0.2",
|
|
57
|
+
"@semantic-release/git": "^10.0.1",
|
|
58
|
+
"@semantic-release/github": "^8.0.2",
|
|
59
|
+
"@semantic-release/npm": "^8.0.3",
|
|
60
|
+
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
51
61
|
"commitizen": "^4.2.4",
|
|
52
|
-
"conventional-changelog-conventionalcommits": "^4.6.
|
|
62
|
+
"conventional-changelog-conventionalcommits": "^4.6.1",
|
|
53
63
|
"cz-conventional-changelog": "^3.3.0",
|
|
54
64
|
"semantic-release-conventional-commits": "^2.0.1"
|
|
55
65
|
},
|
|
56
66
|
"devDependencies": {
|
|
57
|
-
"semantic-release": "^
|
|
67
|
+
"semantic-release": "^18.0.1"
|
|
58
68
|
},
|
|
59
69
|
"peerDependencies": {
|
|
60
|
-
"semantic-release": "^
|
|
70
|
+
"semantic-release": "^18.0.1"
|
|
61
71
|
},
|
|
62
72
|
"engines": {
|
|
63
73
|
"node": ">=12"
|