Browse Source

👷 add scemantic release

pull/3/head
Nicolas Beaussart 6 years ago
parent
commit
87ee156a06
No known key found for this signature in database GPG Key ID: 51D5A407BFCE64A9
  1. 28
      .circleci/config.yml
  2. 175
      .github/release-template.hbs
  3. 66
      .releaserc.js
  4. 14
      package.json
  5. 3806
      yarn.lock

28
.circleci.old/config.yml → .circleci/config.yml

@ -1,4 +1,3 @@
---
version: 2 version: 2
jobs: jobs:
node-latest: &test node-latest: &test
@ -11,7 +10,7 @@ jobs:
keys: keys:
- v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}} - v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
- v1-npm-{{checksum ".circleci/config.yml"}} - v1-npm-{{checksum ".circleci/config.yml"}}
- run:
- run: &yarn_install
name: Install dependencies name: Install dependencies
command: yarn command: yarn
- run: ./bin/run --version - run: ./bin/run --version
@ -31,19 +30,26 @@ jobs:
<<: *test <<: *test
steps: steps:
- checkout - checkout
- run:
name: Install dependencies
command: yarn
- *yarn_install
- save_cache: - save_cache:
key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}} key: v1-npm-{{checksum ".circleci/config.yml"}}-{{checksum "yarn.lock"}}
paths: paths:
- ~/cli/node_modules - ~/cli/node_modules
- /usr/local/share/.cache/yarn - /usr/local/share/.cache/yarn
- /usr/local/share/.config/yarn - /usr/local/share/.config/yarn
release:
<<: *test
steps:
- checkout
- *restore_cache
- *yarn_install
- run:
name: release
command: yarn release || true
workflows: workflows:
version: 2 version: 2
'nbx':
nbx:
jobs: jobs:
- node-latest - node-latest
- node-12 - node-12
@ -53,4 +59,12 @@ workflows:
tags: tags:
only: /^v.*/ only: /^v.*/
branches: branches:
ignore: /.*/
only: master
- release:
requires:
- node-latest
- node-12
- node-10
filter:
branches:
only: master

175
.github/release-template.hbs

@ -0,0 +1,175 @@
{{#if compareUrl}}
# [v{{nextRelease.version}}]({{compareUrl}}) ({{datetime "UTC:yyyy-mm-dd"}})
{{else}}
# v{{nextRelease.version}} ({{datetime "UTC:yyyy-mm-dd"}})
{{/if}}
{{#with commits}}
{{#if sparkles}}
## ✨ New Features
{{#each sparkles}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if bug}}
## 🐛 Bug Fixes
{{#each bug}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if lipstick}}
## 💄 Style and UI updates
{{#each lipstick}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if ambulance}}
## 🚑 Critical Hotfixes
{{#each ambulance}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if lock}}
## 🔒 Security Issues
{{#each lock}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if boom}}
## 💥 Breaking Changes
{{#each boom}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if zap}}
## ⚡ Improved performance
{{#each zap}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if apple}}
## 🍎 Fixed something on macOS
{{#each apple}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if penguin}}
## 🐧 Fixed something on Linux
{{#each penguin}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if checkered_flag}}
## 🏁 Fixed something on Windows
{{#each checkered_flag}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if robot}}
## 🤖 Fixed something on Android
{{#each robot}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if green_apple}}
## 🍏 Fixed something on iOS
{{#each green_apple}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if chart_with_upwards_trend}}
## 📈 Added analytics or tracking
{{#each chart_with_upwards_trend}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if globe_with_meridians}}
## 🌐 Internationalization and localization work
{{#each globe_with_meridians}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if alien}}
## 👽 Update code due to external API changes
{{#each alien}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if wheelchair}}
## ♿ Improved accessibility.
{{#each wheelchair}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if loud_sound}}
## 🔊 Added logs
{{#each loud_sound}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if mute}}
## 🔇 Removed logs
{{#each mute}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if mag}}
## 🔍 Improved SEO
{{#each mag}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if children_crossing}}
## 🚸 Improved user experience / usability
{{#each children_crossing}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if speech_balloon}}
## 💬 Updated text and literals
{{#each speech_balloon}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if iphone}}
## 📱 Worked on responsive design
{{#each iphone}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if pencil2}}
## ✏️ Fixed typos
{{#each pencil2}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{#if bento}}
## 🍱 Added or updated assets
{{#each bento}}
- {{> commitTemplate}}
{{/each}}
{{/if}}
{{/with}}

66
.releaserc.js

@ -0,0 +1,66 @@
const { readFileSync } = require('fs');
const path = require('path');
const releaseTemplate = readFileSync(path.join('.github', 'release-template.hbs'));
module.exports = {
plugins: [
[
'semantic-release-gitmoji',
{
releaseRules: {
major: [':boom:'],
minor: [':sparkles:'],
patch: [
':bug:',
':ambulance:',
':lipstick:',
':lock:',
':zap:',
':apple:',
':penguin:',
':checkered_flag:',
':robot:',
':green_apple:',
':chart_with_upwards_trend:',
':globe_with_meridians:',
':alien:',
':wheelchair:',
':loud_sound:',
':mute:',
':mag:',
':children_crossing:',
':speech_balloon:',
':iphone:',
':pencil2:',
':bento:',
],
},
releaseNotes: {
template: releaseTemplate,
},
},
],
[
'@semantic-release/exec',
{
prepareCmd: 'yarn update-readme',
},
],
'@semantic-release/github',
'@semantic-release/npm',
[
'@semantic-release/changelog',
{
changelogFile: 'CHANGELOG.md',
},
],
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'package.json', 'README.md'],
message: ':bookmark: ${nextRelease.version}\n\n${nextRelease.notes}',
},
],
],
};

14
package.json

@ -1,7 +1,7 @@
{ {
"name": "nbx",
"name": "@beaussan/nbx",
"description": "My own personal cli", "description": "My own personal cli",
"version": "2.0.0",
"version": "1.1.0",
"author": "Nicolas Beaussart @beaussan", "author": "Nicolas Beaussart @beaussan",
"bin": { "bin": {
"nbx": "./bin/run" "nbx": "./bin/run"
@ -25,6 +25,9 @@
}, },
"devDependencies": { "devDependencies": {
"@oclif/dev-cli": "1.22.2", "@oclif/dev-cli": "1.22.2",
"@semantic-release/changelog": "5.0.0",
"@semantic-release/exec": "5.0.0",
"@semantic-release/git": "9.0.0",
"@types/node": "10.17.14", "@types/node": "10.17.14",
"@types/nodegit": "0.26.1", "@types/nodegit": "0.26.1",
"@types/prompts": "2.0.3", "@types/prompts": "2.0.3",
@ -37,6 +40,8 @@
"husky": "4.2.1", "husky": "4.2.1",
"prettier": "1.19.1", "prettier": "1.19.1",
"pretty-quick": "2.0.1", "pretty-quick": "2.0.1",
"semantic-release": "17.0.2",
"semantic-release-gitmoji": "1.3.2",
"ts-node": "8.6.2", "ts-node": "8.6.2",
"typescript": "3.7.5" "typescript": "3.7.5"
}, },
@ -76,9 +81,10 @@
"posttest": "eslint . --ext .ts --config .eslintrc", "posttest": "eslint . --ext .ts --config .eslintrc",
"prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme", "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
"test": "echo NO TESTS", "test": "echo NO TESTS",
"version": "oclif-dev readme && git add README.md",
"update-readme": "oclif-dev readme",
"format:write": "prettier --write \"**/*.{js,vue,json,ts,tsx,md,yml,html}\"", "format:write": "prettier --write \"**/*.{js,vue,json,ts,tsx,md,yml,html}\"",
"format:check": "prettier --list-different \"**/*.{js,vue,json,ts,tsx,md,yml,html}\""
"format:check": "prettier --list-different \"**/*.{js,vue,json,ts,tsx,md,yml,html}\"",
"release": "semantic-release"
}, },
"types": "lib/index.d.ts", "types": "lib/index.d.ts",
"husky": { "husky": {

3806
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save