Skip to content

Commit 2662d46

Browse files
chore(build): use semantic release to publish the new versions (#360)
1 parent 1a55d95 commit 2662d46

File tree

10 files changed

+4432
-424
lines changed

10 files changed

+4432
-424
lines changed

.env-example

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## Pull Request checklist:
22

33
- [ ] Write an explicit title for the Pull Request, following [Conventional Commits specification](https://www.conventionalcommits.org)
4-
- [ ] Write changes made in the CHANGELOG.md
54
- [ ] Create automatic tests
65
- [ ] No automatic tests failures
76
- [ ] Test manually the implemented changes

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ build/
4040
.rvmrc
4141

4242
node_modules/
43-
.env

.releaserc.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
module.exports = {
2+
plugins: [
3+
'@semantic-release/commit-analyzer',
4+
'@semantic-release/release-notes-generator',
5+
'@semantic-release/changelog',
6+
[
7+
'@semantic-release/exec',
8+
{
9+
prepareCmd: 'sed -i \'\' \'s/"version": ".*"/"version": "${nextRelease.version}"/g\' package.json; sed -i \'\' \'s/VERSION = ".*"/VERSION = "${nextRelease.version}"/g\' lib/forest_liana/version.rb;',
10+
successCmd: 'touch .trigger-rubygem-release',
11+
},
12+
],
13+
'@semantic-release/git',
14+
'@semantic-release/github',
15+
[
16+
'semantic-release-slack-bot',
17+
{
18+
markdownReleaseNotes: true,
19+
notifyOnSuccess: true,
20+
notifyOnFail: false,
21+
onSuccessTemplate: {
22+
text: "📦 $package_name@$npm_package_version has been released!",
23+
blocks: [{
24+
type: 'section',
25+
text: {
26+
type: 'mrkdwn',
27+
text: '*New `$package_name` package released!*'
28+
}
29+
}, {
30+
type: 'context',
31+
elements: [{
32+
type: 'mrkdwn',
33+
text: "📦 *Version:* <$repo_url/releases/tag/v$npm_package_version|$npm_package_version>"
34+
}]
35+
}, {
36+
type: 'divider',
37+
}],
38+
attachments: [{
39+
blocks: [{
40+
type: 'section',
41+
text: {
42+
type: 'mrkdwn',
43+
text: '*Changes* of version $release_notes',
44+
},
45+
}],
46+
}],
47+
},
48+
packageName: 'forest_liana',
49+
}
50+
],
51+
],
52+
}

.travis.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,33 @@ language: ruby
33
before_install:
44
- gem install bundler -v '1.17.3'
55

6-
rvm:
7-
- 2.3.4
6+
rvm: 2.3.4
87

9-
script:
10-
- RAILS_ENV=test bundle exec rake test
11-
- RAILS_ENV=test bundle exec rake db:migrate && bundle exec rspec --color --format doc
8+
stages:
9+
- Lint commit messages
10+
- Tests
11+
- Build & Publish
12+
13+
jobs:
14+
include:
15+
- stage: Lint commit messages
16+
language: node_js
17+
node_js: lts/*
18+
before_install:
19+
- nvm install lts/*
20+
- npm install
21+
script: commitlint-travis
22+
- stage: Tests
23+
script:
24+
- RAILS_ENV=test bundle exec rake test
25+
- RAILS_ENV=test bundle exec rake db:migrate && bundle exec rspec --color --format doc
26+
- stage: Build & Publish
27+
if: branch = master AND type != pull_request
28+
script: yarn && npx semantic-release
29+
deploy:
30+
provider: rubygems
31+
api_key: $RUBYGEMS_TOKEN
32+
gem: forest_liana
33+
gemspec: forest_liana.gemspec
34+
on:
35+
condition: [ -f ./.trigger-rubygem-release ]

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Change Log
2-
3-
## [Unreleased]
4-
51
## RELEASE 5.1.2 - 2020-05-12
62
### Changed
73
- Technical - Patch CI configuration warnings.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Forest Admin in Rails
22
[![Gem](https://badge.fury.io/rb/forest_liana.svg)](https://badge.fury.io/rb/forest_liana)
33
[![CI status](https://travis-ci.org/ForestAdmin/forest-rails.svg?branch=devel)](https://travis-ci.org/ForestAdmin/forest-rails)
4+
[![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)
45

56
Forest Admin provides an off-the-shelf administration panel based on a highly-extensible API plugged into your application.
67

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"test": "test"
77
},
88
"scripts": {
9-
"test": "echo \"Error: no test specified\" && exit 1",
10-
"release": "node ./scripts/release.js"
9+
"test": "echo \"Error: no test specified\" && exit 1"
1110
},
1211
"repository": {
1312
"type": "git",
@@ -22,11 +21,12 @@
2221
"devDependencies": {
2322
"@commitlint/cli": "8.3.5",
2423
"@commitlint/config-conventional": "8.3.4",
25-
"@forestadmin/devops": "2.0.1",
26-
"dotenv": "8.1.0",
24+
"@commitlint/travis-cli": "8.3.5",
25+
"@semantic-release/changelog": "5.0.1",
26+
"@semantic-release/exec": "5.0.0",
27+
"@semantic-release/git": "9.0.0",
2728
"husky": "4.2.5",
28-
"moment": "^2.20.1",
29-
"semver": "5.3.0",
30-
"simple-git": "1.78.0"
29+
"semantic-release": "17.0.7",
30+
"semantic-release-slack-bot": "1.6.2"
3131
}
32-
}
32+
}

scripts/release.js

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)