Skip to content

Commit

Permalink
chore(build): use semantic release to publish the new versions (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbesnier authored May 13, 2020
1 parent 7f38e16 commit 6fd9fdd
Show file tree
Hide file tree
Showing 9 changed files with 3,540 additions and 89 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
'error',
{
devDependencies: [
'bin/deploy.js',
'scripts/*.js',
'test/**/*.js',
]
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
node_modules/
.env
.nyc_output/
coverage/
yarn-error.log
Expand Down
46 changes: 46 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
'@semantic-release/git',
'@semantic-release/github',
[
'semantic-release-slack-bot',
{
markdownReleaseNotes: true,
notifyOnSuccess: true,
notifyOnFail: false,
onSuccessTemplate: {
text: "🛠 $package_name@$npm_package_version has been released!",
blocks: [{
type: 'section',
text: {
type: 'mrkdwn',
text: '*New `$package_name` package released!*'
}
}, {
type: 'context',
elements: [{
type: 'mrkdwn',
text: "🛠 *Version:* <$repo_url/releases/tag/v$npm_package_version|$npm_package_version>"
}]
}, {
type: 'divider',
}],
attachments: [{
blocks: [{
type: 'section',
text: {
type: 'mrkdwn',
text: '*Changes* of version $release_notes',
},
}],
}],
},
packageName: 'forest-cli',
}
],
],
}
25 changes: 21 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
language: node_js
node_js: lts/*

script:
- commitlint-travis
- yarn lint
- yarn test
stages:
- Lint & Tests
- Build & Publish

jobs:
include:
- stage: Lint & Tests
name: Lint commit messages
script: commitlint-travis
- script: yarn lint
name: Lint JavaScript
- script: yarn test
name: Tests
- stage: Build & Publish
if: branch = master AND type != pull_request
script: skip
deploy:
provider: script
on:
branch: master
script: yarn && npx semantic-release
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Change Log

## [Unreleased]

## RELEASE 1.2.0 - 2020-05-13
### Added
- Technical - Add sonar lint.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![npm package](https://badge.fury.io/js/forest-cli.svg)](https://badge.fury.io/js/forest-cli)
[![Build Status](https://travis-ci.org/ForestAdmin/toolbelt.svg?branch=master)](https://travis-ci.org/ForestAdmin/toolbelt)
![Coverage](https://img.shields.io/badge/coverage-88%25%0A-critical)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

The Lumberjacks' toolbelt is the Forest Admin CLI which makes easy to manage your back office application directly from the terminal.

Expand Down
8 changes: 0 additions & 8 deletions bin/deploy.js

This file was deleted.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"@commitlint/config-conventional": "8.3.4",
"@commitlint/travis-cli": "8.3.5",
"@forestadmin/devops": "2.0.1",
"@semantic-release/changelog": "5.0.1",
"@semantic-release/git": "9.0.0",
"eslint": "6.7.2",
"eslint-config-airbnb-base": "14.0.0",
"eslint-config-oclif": "3.1.0",
Expand All @@ -51,6 +53,8 @@
"jest": "24.9.0",
"mock-stdin": "1.0.0",
"nock": "12.0.3",
"semantic-release": "17.0.7",
"semantic-release-slack-bot": "1.6.2",
"simple-git": "1.65.0",
"stdout-stderr": "0.1.13"
},
Expand Down Expand Up @@ -85,8 +89,7 @@
},
"repository": "ForestAdmin/toolbelt",
"scripts": {
"build": "node ./bin/deploy.js",
"lint": "./node_modules/eslint/bin/eslint.js bin src test",
"lint": "./node_modules/eslint/bin/eslint.js src test",
"postpack": "rm -f oclif.manifest.json",
"prepack": "oclif-dev manifest && oclif-dev readme",
"readme:update-coverage": "yarn test:coverage && node ./scripts/update-coverage.js",
Expand Down
Loading

0 comments on commit 6fd9fdd

Please sign in to comment.