Skip to content

Commit cc5a0b1

Browse files
committed
feat(core): 🎸 automação completa de versão para o projeto
Agora todo novo commit, merge ou PR feito no branch master aciona uma nova versão do livro e todos os arquivos associados ao processo. Tudo de forma automática, sem se preocupar com nada.
1 parent 5b825a3 commit cc5a0b1

File tree

8 files changed

+230
-20
lines changed

8 files changed

+230
-20
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
book-output
22
book-release*
33

4+
### NODE.JS ###
5+
node_modules*
6+
npm-debug.log
7+
48
### OSX ###
59
*.DS_Store
610
._*

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.releaserc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
"@semantic-release/changelog",
6+
["@semantic-release/git", {
7+
"assets": ["package.json", "CHANGELOG.md"],
8+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
9+
}],
10+
"@semantic-release/github"
11+
]
12+
}

.travis.yml

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
1+
language: ruby
12
sudo: required
23

3-
services:
4-
- docker
5-
64
env:
7-
- COMPOSE_FILE=docker-compose.yml
8-
9-
script:
10-
- ls -lah
11-
- docker-compose run --rm ebook
5+
global:
6+
- secure: ygR+ubsOCcsILpZ9ftQ7hYeYohHS4K4U8l1LSimNoNgvf+6xxu9Pjp/uTbiWWj/J4Jc9uQiITM3h5hRxZKNO+m7kQKprRcEXIaT/vDkQWmWB+4G72hon5fwqdhKW++i5IOOXUUPQrEqpXovccgBiwVdwfvMjtp9WIx2lGDNPHAu9rzWJhQF9qlHq+an61K+Ft65OI00qgr6C7Os/va3YZFsdK+0Y4WasX2pXJgvf5TQvy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IsIC6Sx4XX8Pg7xnVXenfE+9AN2mCeZNq2tq0kTRqhclr+2T5IdUm9zB90I2VfK+6tuOPsb4DKhhJRtZsUZLMCIW4NA=
17-
file_glob: true
18-
file: book-release/*
19-
skip_cleanup: true
20-
on:
21-
tags: true
8+
jobs:
9+
include:
10+
- stage: "Semantic Release"
11+
name: "Generate a new release and changelogs"
12+
language: node_js
13+
node_js: lts/*
14+
os:
15+
- linux
16+
install:
17+
- npm install
18+
script: skip
19+
deploy:
20+
provider: script
21+
api_key: "$GITHUB_TOKEN"
22+
node_js: lts/*
23+
skip_cleanup: true
24+
script: npx semantic-release
25+
on:
26+
branch: master
2227

23-
notifications:
24-
email:
25-
28+
- stage: "GitHub Release"
29+
name: "Send the generated files to the new GitHub release"
30+
services:
31+
- docker
32+
env:
33+
- COMPOSE_FILE=docker-compose.yml
34+
script:
35+
- TRAVIS_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
36+
- git shortlog -s | cut -f 2- > book/contributors.txt
37+
- docker-compose run --rm ebook $TRAVIS_TAG
38+
deploy:
39+
provider: releases
40+
api_key: "$GITHUB_TOKEN"
41+
file_glob: true
42+
file: book-release/*
43+
skip_cleanup: true
44+
on:
45+
branch: master

changelog.config.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
module.exports = {
2+
"disableEmoji": false,
3+
"list": [
4+
"test",
5+
"feat",
6+
"fix",
7+
"chore",
8+
"docs",
9+
"refactor",
10+
"style",
11+
"ci",
12+
"perf"
13+
],
14+
"maxMessageLength": 64,
15+
"minMessageLength": 3,
16+
"questions": [
17+
"type",
18+
"scope",
19+
"subject",
20+
"body",
21+
"breaking",
22+
"issues",
23+
"lerna"
24+
],
25+
"scopes": [
26+
"",
27+
"core",
28+
"lang-enh",
29+
"localization",
30+
"lambda",
31+
"streams",
32+
"concurrency",
33+
"file-io",
34+
"collections"
35+
],
36+
"types": {
37+
"chore": {
38+
"description": "Build process or auxiliary tool changes",
39+
"emoji": "🤖",
40+
"value": "chore"
41+
},
42+
"ci": {
43+
"description": "CI related changes",
44+
"emoji": "🎡",
45+
"value": "ci"
46+
},
47+
"docs": {
48+
"description": "Documentation only changes",
49+
"emoji": "📓",
50+
"value": "docs"
51+
},
52+
"feat": {
53+
"description": "A new feature",
54+
"emoji": "🎸",
55+
"value": "feat"
56+
},
57+
"fix": {
58+
"description": "A bug fix",
59+
"emoji": "🐛",
60+
"value": "fix"
61+
},
62+
"perf": {
63+
"description": "A code change that improves performance",
64+
"emoji": "⚡️",
65+
"value": "perf"
66+
},
67+
"refactor": {
68+
"description": "A code change that neither fixes a bug or adds a feature",
69+
"emoji": "💡",
70+
"value": "refactor"
71+
},
72+
"release": {
73+
"description": "Create a release commit",
74+
"emoji": "🏹",
75+
"value": "release"
76+
},
77+
"style": {
78+
"description": "Markup, white-space, formatting, missing semi-colons...",
79+
"emoji": "💄",
80+
"value": "style"
81+
},
82+
"test": {
83+
"description": "Adding missing tests",
84+
"emoji": "💍",
85+
"value": "test"
86+
}
87+
}
88+
};

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ services:
77
- .:/documents/
88
command: scripts/docker-startup.sh
99
network_mode: bridge
10+
11+
travis:
12+
build:
13+
context: .
14+
dockerfile: ./docker/travis/Dockerfile
15+
volumes:
16+
- .:/app
17+
- ./.travis:/root/.travis
18+
network_mode: bridge

docker/travis/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ruby:alpine
2+
3+
RUN apk --update add build-base git \
4+
&& gem install travis \
5+
&& apk del build-base \
6+
&& rm -rf /var/cache/apk/* \
7+
&& rm -rf /tmp/* \
8+
&& mkdir app
9+
10+
WORKDIR app
11+
VOLUME ["/app"]
12+
13+
LABEL maintainer="twitter.com/rcmoutinho"
14+
LABEL description="Travis CLI in a docker container"
15+
16+
ENTRYPOINT ["travis"]
17+
CMD ["--help"]

package.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"author": "Rinaldo Pitzer e Rodrigo Moutinho",
3+
"name": "java6-to-java8",
4+
"description": "Guia para ajudar devs Java atualizarem sua certificação Java 6 para Java 8.",
5+
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/duke-certification/java6-to-java8.git"
9+
},
10+
"bugs": {
11+
"url": "https://github.com/duke-certification/java6-to-java8/issues"
12+
},
13+
"homepage": "https://github.com/duke-certification/java6-to-java8",
14+
"keywords": [
15+
"java",
16+
"java6",
17+
"java8",
18+
"certificate",
19+
"developer",
20+
"update",
21+
"guide"
22+
],
23+
"dependencies": {},
24+
"devDependencies": {
25+
"@commitlint/cli": "^8.0.0",
26+
"@commitlint/config-conventional": "^8.0.0",
27+
"@commitlint/prompt": "^8.0.0",
28+
"@semantic-release/changelog": "^3.0.4",
29+
"@semantic-release/commit-analyzer": "^6.2.0",
30+
"@semantic-release/git": "^7.0.16",
31+
"@semantic-release/github": "^5.4.2",
32+
"@semantic-release/release-notes-generator": "^7.2.1",
33+
"commitizen": "^3.1.1",
34+
"git-cz": "^3.0.1",
35+
"husky": "^2.7.0",
36+
"semantic-release": "^15.13.18",
37+
"semantic-release-cli": "^5.1.1"
38+
},
39+
"husky": {
40+
"hooks": {
41+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
42+
}
43+
},
44+
"scripts": {
45+
"commit": "./node_modules/.bin/git-cz",
46+
"semantic-release": "./node_modules/.bin/semantic-release",
47+
"semantic-release-cli": "./node_modules/.bin/semantic-release-cli"
48+
},
49+
"commitlint": {
50+
"extends": [
51+
"@commitlint/config-conventional"
52+
]
53+
},
54+
"config": {
55+
"commitizen": {
56+
"path": "@commitlint/prompt"
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)