mirror of
https://github.com/ivuorinen/base-configs.git
synced 2026-03-11 20:58:18 +00:00
Initial commit
This commit is contained in:
3
packages/semantic-release-config/CHANGELOG.md
Normal file
3
packages/semantic-release-config/CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
21
packages/semantic-release-config/LICENSE
Normal file
21
packages/semantic-release-config/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 Ismo Vuorinen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
134
packages/semantic-release-config/README.md
Normal file
134
packages/semantic-release-config/README.md
Normal file
@@ -0,0 +1,134 @@
|
||||
# @ivuorinen/semantic-release-config <!-- omit in toc -->
|
||||
|
||||
[![npm package][npm-badge]][npm-link]
|
||||
[![license MIT][license-badge]][license-link]
|
||||
[![ivuorinen's Code Style][style-badge]][style-link]
|
||||
|
||||
> ivuorinen's shareable configuration for [`semantic-release`][semantic-release-link].
|
||||
|
||||
## Table of Contents <!-- omit in toc -->
|
||||
|
||||
- [Plugins](#plugins)
|
||||
- [Installation](#installation)
|
||||
- [Configuration](#configuration)
|
||||
- [GitHub Actions](#github-actions)
|
||||
- [Documentations](#documentations)
|
||||
- [Contributing](#contributing)
|
||||
- [Changelog](#changelog)
|
||||
- [License](#license)
|
||||
|
||||
## Plugins
|
||||
|
||||
This shareable configuration use the following plugins:
|
||||
|
||||
- [`@semantic-release/commit-analyzer`][sr-commit-analyzer-link]
|
||||
- [`@semantic-release/release-notes-generator`][sr-release-notes-generator-link]
|
||||
- [`@semantic-release/changelog`][sr-changelog-link]
|
||||
- [`@semantic-release/npm`][sr-npm-link]
|
||||
- [`@semantic-release/github`][sr-github-link]
|
||||
- [`@semantic-release/git`][sr-git-link]
|
||||
|
||||
## Installation
|
||||
|
||||
Install `this config` as a _`devDependencies`_:
|
||||
|
||||
```sh
|
||||
# npm
|
||||
npm install @ivuorinen/semantic-release-config --save-dev
|
||||
|
||||
# Yarn
|
||||
yarn add @ivuorinen/semantic-release-config --dev
|
||||
```
|
||||
|
||||
After installing it, a _`.releaserc.json`_ file will be created automatically in the project's root folder with the following configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
"extends": ["@ivuorinen/semantic-release-config"]
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Ensure that your CI configuration has the following **_secret_** environment variables set:
|
||||
|
||||
- [`GH_TOKEN`][gh-token-link] with [`public_repo`][gh-scopes-link] access or `GITHUB_TOKEN`.
|
||||
- [`NPM_TOKEN`][npm-token-link]
|
||||
|
||||
See each [plugin](#plugins) documentation for required installation and configuration steps.
|
||||
|
||||
## GitHub Actions
|
||||
|
||||
```yaml
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js Environment
|
||||
uses: actions/setup-node@v2.1.5
|
||||
with:
|
||||
always-auth: true
|
||||
node-version: 14
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
|
||||
- name: Install Dependencies with Caching
|
||||
uses: bahmutov/npm-install@v1.6.0
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: yarn run semantic-release
|
||||
```
|
||||
|
||||
## Documentations
|
||||
|
||||
Read the [semantic-release docs][semantic-release-docs-link] for more information.
|
||||
|
||||
## Contributing
|
||||
|
||||
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].
|
||||
|
||||
## Changelog
|
||||
|
||||
See [CHANGELOG][changelog-link] for a human-readable history of changes.
|
||||
|
||||
## License
|
||||
|
||||
Distributed under the MIT License. See [LICENSE][license-link] for more information.
|
||||
|
||||
[changelog-link]: ./CHANGELOG.md
|
||||
[contributing-link]: https://github.com/ivuorinen/.github/blob/main/CONTRIBUTING.md
|
||||
[gh-scopes-link]: https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes
|
||||
[gh-token-link]: https://github.com/settings/tokens/new?scopes=public_repo
|
||||
[issue-link]: https://github.com/ivuorinen/base-configs/issues
|
||||
[license-badge]: https://img.shields.io/github/license/ivuorinen/base-configs?style=flat-square&labelColor=292a44&color=663399
|
||||
[license-link]: ./LICENSE
|
||||
[npm-badge]: https://img.shields.io/npm/v/@ivuorinen/semantic-release-config?style=flat-square&labelColor=292a44&color=663399
|
||||
[npm-link]: https://www.npmjs.com/package/@ivuorinen/semantic-release-config
|
||||
[npm-token-link]: https://docs.npmjs.com/about-access-tokens
|
||||
[pull-request-link]: https://github.com/ivuorinen/base-configs/pulls
|
||||
[semantic-release-docs-link]: https://semantic-release.gitbook.io/
|
||||
[semantic-release-link]: https://github.com/semantic-release/semantic-release
|
||||
[sr-changelog-link]: https://github.com/semantic-release/changelog
|
||||
[sr-commit-analyzer-link]: https://github.com/semantic-release/commit-analyzer
|
||||
[sr-git-link]: https://github.com/semantic-release/git
|
||||
[sr-github-link]: https://github.com/semantic-release/github
|
||||
[sr-npm-link]: https://github.com/semantic-release/npm
|
||||
[sr-release-notes-generator-link]: https://github.com/semantic-release/release-notes-generator
|
||||
[style-badge]: https://img.shields.io/badge/code_style-ivuorinen%E2%80%99s-663399.svg?labelColor=292a44&style=flat-square
|
||||
[style-link]: https://github.com/ivuorinen/base-configs
|
||||
19
packages/semantic-release-config/index.js
Normal file
19
packages/semantic-release-config/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
'@semantic-release/commit-analyzer',
|
||||
'@semantic-release/release-notes-generator',
|
||||
[
|
||||
'@semantic-release/changelog',
|
||||
{
|
||||
changelogTitle:
|
||||
'# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines.'
|
||||
}
|
||||
],
|
||||
'@semantic-release/npm',
|
||||
'@semantic-release/github',
|
||||
'@semantic-release/git'
|
||||
],
|
||||
preset: 'angular'
|
||||
}
|
||||
45
packages/semantic-release-config/package.json
Normal file
45
packages/semantic-release-config/package.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@ivuorinen/semantic-release-config",
|
||||
"version": "0.1.0",
|
||||
"description": "ivuorinen's shareable configuration for semantic-release.",
|
||||
"author": {
|
||||
"name": "Ismo Vuorinen",
|
||||
"url": "https://github.com/ivuorinen"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/ivuorinen/base-configs/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12",
|
||||
"npm": ">= 6",
|
||||
"yarn": ">=1.20.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"scripts/*"
|
||||
],
|
||||
"homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/semantic-release-config#readme",
|
||||
"keywords": [
|
||||
"semantic-release-config",
|
||||
"semantic-release",
|
||||
"config",
|
||||
"ivuorinen"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ivuorinen/base-configs.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node scripts/postinstall.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@semantic-release/changelog": "6.0.2",
|
||||
"@semantic-release/git": "10.0.1",
|
||||
"semantic-release": "19.0.5"
|
||||
}
|
||||
}
|
||||
14
packages/semantic-release-config/scripts/postinstall.js
Normal file
14
packages/semantic-release-config/scripts/postinstall.js
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict'
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const filePath = path.join(process.env.INIT_CWD, '.releaserc.json')
|
||||
|
||||
const fileConfigObject = {
|
||||
extends: ['@ivuorinen/semantic-release-config']
|
||||
}
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(fileConfigObject, undefined, 2))
|
||||
}
|
||||
3360
packages/semantic-release-config/yarn.lock
Normal file
3360
packages/semantic-release-config/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user