@ivuorinen/semantic-release-config 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Ismo Vuorinen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # @ivuorinen/semantic-release-config <!-- omit in toc -->
2
+
3
+ [![npm package][npm-badge]][npm-link]
4
+ [![license MIT][license-badge]][license-link]
5
+ [![ivuorinen's Code Style][style-badge]][style-link]
6
+
7
+ > ivuorinen's shareable configuration for [`semantic-release`][semantic-release-link].
8
+
9
+ ## Table of Contents <!-- omit in toc -->
10
+
11
+ - [Plugins](#plugins)
12
+ - [Installation](#installation)
13
+ - [Configuration](#configuration)
14
+ - [GitHub Actions](#github-actions)
15
+ - [Documentations](#documentations)
16
+ - [Contributing](#contributing)
17
+ - [Changelog](#changelog)
18
+ - [License](#license)
19
+
20
+ ## Plugins
21
+
22
+ This shareable configuration use the following plugins:
23
+
24
+ - [`@semantic-release/commit-analyzer`][sr-commit-analyzer-link]
25
+ - [`@semantic-release/release-notes-generator`][sr-release-notes-generator-link]
26
+ - [`@semantic-release/changelog`][sr-changelog-link]
27
+ - [`@semantic-release/npm`][sr-npm-link]
28
+ - [`@semantic-release/github`][sr-github-link]
29
+ - [`@semantic-release/git`][sr-git-link]
30
+
31
+ ## Installation
32
+
33
+ Install `this config` as a _`devDependencies`_:
34
+
35
+ ```sh
36
+ # npm
37
+ npm install @ivuorinen/semantic-release-config --save-dev
38
+
39
+ # Yarn
40
+ yarn add @ivuorinen/semantic-release-config --dev
41
+ ```
42
+
43
+ After installing it, a _`.releaserc.json`_ file will be created automatically in the project's root folder with the following configuration:
44
+
45
+ ```json
46
+ {
47
+ "extends": ["@ivuorinen/semantic-release-config"]
48
+ }
49
+ ```
50
+
51
+ ## Configuration
52
+
53
+ Ensure that your CI configuration has the following **_secret_** environment variables set:
54
+
55
+ - [`GH_TOKEN`][gh-token-link] with [`public_repo`][gh-scopes-link] access or `GITHUB_TOKEN`.
56
+ - [`NPM_TOKEN`][npm-token-link]
57
+
58
+ See each [plugin](#plugins) documentation for required installation and configuration steps.
59
+
60
+ ## GitHub Actions
61
+
62
+ ```yaml
63
+ name: Release
64
+
65
+ on:
66
+ push:
67
+ branches:
68
+ - main
69
+
70
+ jobs:
71
+ release:
72
+ name: Release
73
+ runs-on: ubuntu-latest
74
+
75
+ steps:
76
+ - name: Checkout
77
+ uses: actions/checkout@v2.3.4
78
+ with:
79
+ fetch-depth: 0
80
+
81
+ - name: Setup Node.js Environment
82
+ uses: actions/setup-node@v2.1.5
83
+ with:
84
+ always-auth: true
85
+ node-version: 14
86
+ registry-url: "https://registry.npmjs.org"
87
+
88
+ - name: Install Dependencies with Caching
89
+ uses: bahmutov/npm-install@v1.6.0
90
+
91
+ - name: Release
92
+ env:
93
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
95
+ run: yarn run semantic-release
96
+ ```
97
+
98
+ ## Documentations
99
+
100
+ Read the [semantic-release docs][semantic-release-docs-link] for more information.
101
+
102
+ ## Contributing
103
+
104
+ If you are interested in helping contribute, please take a look at our [contribution guidelines][contributing-link] and open an [issue][issue-link] or [pull request][pull-request-link].
105
+
106
+ ## Changelog
107
+
108
+ See [CHANGELOG][changelog-link] for a human-readable history of changes.
109
+
110
+ ## License
111
+
112
+ Distributed under the MIT License. See [LICENSE][license-link] for more information.
113
+
114
+ [changelog-link]: ./CHANGELOG.md
115
+ [contributing-link]: https://github.com/ivuorinen/.github/blob/main/CONTRIBUTING.md
116
+ [gh-scopes-link]: https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes
117
+ [gh-token-link]: https://github.com/settings/tokens/new?scopes=public_repo
118
+ [issue-link]: https://github.com/ivuorinen/base-configs/issues
119
+ [license-badge]: https://img.shields.io/github/license/ivuorinen/base-configs?style=flat-square&labelColor=292a44&color=663399
120
+ [license-link]: ./LICENSE
121
+ [npm-badge]: https://img.shields.io/npm/v/@ivuorinen/semantic-release-config?style=flat-square&labelColor=292a44&color=663399
122
+ [npm-link]: https://www.npmjs.com/package/@ivuorinen/semantic-release-config
123
+ [npm-token-link]: https://docs.npmjs.com/about-access-tokens
124
+ [pull-request-link]: https://github.com/ivuorinen/base-configs/pulls
125
+ [semantic-release-docs-link]: https://semantic-release.gitbook.io/
126
+ [semantic-release-link]: https://github.com/semantic-release/semantic-release
127
+ [sr-changelog-link]: https://github.com/semantic-release/changelog
128
+ [sr-commit-analyzer-link]: https://github.com/semantic-release/commit-analyzer
129
+ [sr-git-link]: https://github.com/semantic-release/git
130
+ [sr-github-link]: https://github.com/semantic-release/github
131
+ [sr-npm-link]: https://github.com/semantic-release/npm
132
+ [sr-release-notes-generator-link]: https://github.com/semantic-release/release-notes-generator
133
+ [style-badge]: https://img.shields.io/badge/code_style-ivuorinen%E2%80%99s-663399.svg?labelColor=292a44&style=flat-square
134
+ [style-link]: https://github.com/ivuorinen/base-configs
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ 'use strict'
2
+
3
+ module.exports = {
4
+ plugins: [
5
+ '@semantic-release/commit-analyzer',
6
+ '@semantic-release/release-notes-generator',
7
+ [
8
+ '@semantic-release/changelog',
9
+ {
10
+ changelogTitle:
11
+ '# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.'
12
+ }
13
+ ],
14
+ '@semantic-release/npm',
15
+ '@semantic-release/github',
16
+ '@semantic-release/git'
17
+ ],
18
+ preset: 'angular'
19
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@ivuorinen/semantic-release-config",
3
+ "version": "0.1.0",
4
+ "description": "ivuorinen's shareable configuration for semantic-release.",
5
+ "author": {
6
+ "name": "Ismo Vuorinen",
7
+ "url": "https://github.com/ivuorinen"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/ivuorinen/base-configs/issues"
11
+ },
12
+ "engines": {
13
+ "node": ">= 12",
14
+ "npm": ">= 6",
15
+ "yarn": ">=1.20.0"
16
+ },
17
+ "files": [
18
+ "index.js",
19
+ "scripts/*"
20
+ ],
21
+ "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/semantic-release-config#readme",
22
+ "keywords": [
23
+ "semantic-release-config",
24
+ "semantic-release",
25
+ "config",
26
+ "ivuorinen"
27
+ ],
28
+ "license": "MIT",
29
+ "main": "index.js",
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/ivuorinen/base-configs.git"
36
+ },
37
+ "scripts": {
38
+ "postinstall": "node scripts/postinstall.js"
39
+ },
40
+ "dependencies": {
41
+ "@semantic-release/changelog": "6.0.2",
42
+ "@semantic-release/git": "10.0.1",
43
+ "semantic-release": "19.0.5"
44
+ },
45
+ "gitHead": "0b2b89ca98caac7995c4c2a3662f0d338043938b"
46
+ }
@@ -0,0 +1,14 @@
1
+ 'use strict'
2
+
3
+ const fs = require('fs')
4
+ const path = require('path')
5
+
6
+ const filePath = path.join(process.env.INIT_CWD, '.releaserc.json')
7
+
8
+ const fileConfigObject = {
9
+ extends: ['@ivuorinen/semantic-release-config']
10
+ }
11
+
12
+ if (!fs.existsSync(filePath)) {
13
+ fs.writeFileSync(filePath, JSON.stringify(fileConfigObject, undefined, 2))
14
+ }