Skip to content

Commit 6b705de

Browse files
committed
💥 Update gitmoji version to 3.2.0(with semver). Remove default-template.
1 parent 6550b8d commit 6b705de

File tree

8 files changed

+38
-125
lines changed

8 files changed

+38
-125
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Generate semantic-release configs
3131
working-directory: ./gitmoji-semver
3232
run: |
33-
make scaffold V=v3.0.0 F=../.semver.yml O=.. T=simple
33+
make scaffold F=../.semver.yml O=..
3434
- name: Release
3535
working-directory: ./.release
3636
env:

.semver.yml

Lines changed: 9 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,14 @@
11
# Release Branches
22
branches: [ master, main ]
33

4-
# gitmoji semver settings (default is none)
4+
# gitmoji semver settings
5+
# You can override the default values to suit your project.
56
semver:
6-
major:
7-
- boom # Introduce breaking changes.
8-
9-
minor:
10-
- sparkles # Introduce new features.
11-
- lipstick # Add or update the UI and style files.
12-
- tada # Begin a project.
13-
- globe_with_meridians # Internationalization and localization.
14-
- bento # Add or update assets.
15-
- wheelchair # Improve accessibility.
16-
- children_crossing # Improve user experience / usability.
17-
- iphone # Work on responsive design.
18-
- egg # Add or update an easter egg.
19-
- triangular_flag_on_post # Add, update, or remove feature flags.
20-
- dizzy # Add or update animations and transitions.
21-
22-
patch:
23-
- art # Improve structure / format of the code.
24-
- zap # Improve performance.
25-
- fire # Remove code or files.
26-
- bug # Fix a bug.
27-
- ambulance # Critical hotfix.
28-
- white_check_mark # Add or update tests.
29-
- lock # Fix security issues.
30-
- rotating_light # Fix compiler / linter warnings.
31-
- green_heart # Fix CI Build.
32-
- arrow_down # Downgrade dependencies.
33-
- arrow_up # Upgrade dependencies.
34-
- pushpin # Pin dependencies to specific versions.
35-
- construction_worker # Add or update CI build system.
36-
- chart_with_upwards_trend # Add or update analytics or track code.
37-
- recycle # Refactor code.
38-
- heavy_plus_sign # Add a dependency.
39-
- heavy_minus_sign # Remove a dependency.
40-
- wrench # Add or update configuration files.
41-
- hammer # Add or update development scripts.
42-
- package # Add or update compiled files or packages.
43-
- alien # Update code due to external API changes.
44-
- truck # Move or rename resources (e.g.: files, paths, routes).
45-
- page_facing_up # Add or update license.
46-
- card_file_box # Perform database related changes.
47-
- loud_sound # Add or update logs.
48-
- mute # Remove logs.
49-
- building_construction # Make architectural changes.
50-
- mag # Improve SEO.
51-
- label # Add or update types.
52-
- goal_net # Catch errors.
53-
54-
none:
55-
- memo # Add or update documentation.
56-
- rocket # Deploy stuff.
57-
- bookmark # Release / Version tags.
58-
- pencil2 # Fix typos.
59-
- poop # Write bad code that needs to be improved.
60-
- rewind # Revert changes.
61-
- twisted_rightwards_arrows # Merge branches.
62-
- bulb # Add or update comments in source code.
63-
- beers # Write code drunkenly.
64-
- speech_balloon # Add or update text and literals.
65-
- busts_in_silhouette # Add or update contributor(s).
66-
- clown_face # Mock things.
67-
- see_no_evil # Add or update a .gitignore file.
68-
- camera_flash # Add or update snapshots.
69-
- alembic # Perform experiments.
70-
- seedling # Add or update seed files.
71-
- wastebasket # Deprecate code that needs to be cleaned up.
72-
73-
# not add in release-template.hbs
74-
ignore:
7+
# minor:
8+
# - lipstick
9+
# patch:
10+
# - art
11+
# none: # gitmoji.json `"semver": null` is convert to none
12+
# - pencil2
13+
ignore: # not add in release-template.hbs
7514
- construction # Work in progress.

Makefile

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Options
2-
V=v3.0.0
2+
V=v3.2.0
33
GITMOJI_VERSION=$(V)
44
F=.semver.yml
55
SEMVER_FILE=$(F)
66
O=./
77
OUT_DIR=$(O)
8-
T=""
9-
TEMPLATE_TYPE=$(T)
108

119
BASE_FILE=https://raw.githubusercontent.com/carloscuesta/gitmoji/$(GITMOJI_VERSION)/src/data/gitmojis.json
1210

@@ -40,10 +38,9 @@ help:
4038
@echo " T=<template type> $(BLUE)Specify release template type 'default or simple'$(RESET)"
4139
@echo
4240
@echo "$(GREEN)Examples:$(RESET)"
43-
@echo " make gen V=v3.0.0 F=./.semver.yml"
41+
@echo " make gen F=./.semver.yml"
4442
@echo " make list"
45-
@echo " make scaffold V=v3.0.0 F=./.semver.yml O=./.playground"
46-
@echo " make scaffold V=v3.0.0 F=./.semver.yml O=./.playground T=simple"
43+
@echo " make scaffold F=./.semver.yml O=./.playground"
4744
@echo
4845

4946
# Generate gitmojis.json with semver field
@@ -59,7 +56,6 @@ gen:
5956
yq '.' $(SEMVER_FILE) > build/src/semver.json
6057
node gitmoji-semver.js
6158
cat build/dist/tmp.json | jq > build/dist/gitmojis.json
62-
yq -y '.' build/dist/gitmojis.json > build/dist/gitmojis.yml
6359
rm build/dist/tmp.json
6460

6561
@echo
@@ -91,17 +87,13 @@ list:
9187
scaffold: gen
9288
@echo
9389
@echo "$(PURPLE)# SCAFFOLD: Generate semantic-release setting files$(RESET)"
94-
node gen-release-template.js $(TEMPLATE_TYPE)
90+
node gen-release-template.js
9591
mkdir -p $(OUT_DIR)/.release
9692
cp -a ./semantic-release-template/. $(OUT_DIR)/.release
9793
cp ./build/dist/release-template.hbs $(OUT_DIR)/.release
9894
cp ./build/dist/gitmojis.json $(OUT_DIR)/.release
9995
cp ./build/src/semver.json $(OUT_DIR)/.release
100-
ifeq ($(TEMPLATE_TYPE),simple)
101-
cp $(OUT_DIR)/.release/commit-template-simple.hbs $(OUT_DIR)/.release/commit-template.hbs
102-
else
103-
cp $(OUT_DIR)/.release/commit-template-default.hbs $(OUT_DIR)/.release/commit-template.hbs
104-
endif
96+
10597
@echo
10698
@echo "$(LIGHTPURPLE)🎉 Add semantic-release setting files$(RESET)"
10799
@echo $(OUT_DIR)/.release

README.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,13 @@
3232

3333
## Features
3434

35-
- :smile:
36-
generate [gitmojis.json](https://github.com/carloscuesta/gitmoji/blob/master/src/data/gitmojis.json)
37-
with semver field.
3835
- :smile: generate [semantic-release](https://github.com/semantic-release/semantic-release) setting
3936
files and release template.
4037
- :rocket: auto release by semver (semantic versioning) just by committing with
4138
gitmoji. ( [like this](https://github.com/nkmr-jp/gitmoji-semver-sample/releases) )
4239

43-
### Release template type
44-
45-
| default ([example](https://github.com/nkmr-jp/gitmoji-semver-sample/releases/tag/v2.4.0)) | simple ([example](https://github.com/nkmr-jp/gitmoji-semver-sample/releases/tag/v2.3.0)) |
46-
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
47-
| ![img.png](https://user-images.githubusercontent.com/8490118/103149917-b831ff80-47b1-11eb-85ac-d0e1328c8ad1.png) | ![img.png](https://user-images.githubusercontent.com/8490118/103149926-c2ec9480-47b1-11eb-810e-1e75ece3319f.png) |
40+
### Release template type ( [example](https://github.com/nkmr-jp/gitmoji-semver-sample/releases/tag/v2.3.0) )
41+
![img.png](https://user-images.githubusercontent.com/8490118/103149926-c2ec9480-47b1-11eb-810e-1e75ece3319f.png)
4842

4943
## How to use in Mac
5044

@@ -90,23 +84,17 @@ example: [./.semver.yml](.semver.yml)
9084
# Release Branches
9185
branches: [ master, main ]
9286

93-
# gitmoji semver settings (default is none)
87+
# gitmoji semver settings
88+
# You can override the default values to suit your project.
9489
semver:
95-
major:
96-
- boom # Introduce breaking changes.
97-
minor:
98-
- sparkles # Introduce new features.
99-
patch:
100-
- bug # Fix a bug.
101-
- ambulance # Critical hotfix.
102-
- green_heart # Fix CI Build.
103-
- construction_worker # Add or update CI build system.
104-
none:
105-
- memo # Add or update documentation.
106-
107-
# Prevents it from appearing in Github's Release.
108-
ignore:
109-
- construction # Work in progress.
90+
# minor:
91+
# - lipstick
92+
# patch:
93+
# - art
94+
# none: # gitmoji.json "semver": null is convert to none
95+
# - pencil2
96+
ignore: # not add in release-template.hbs
97+
- construction
11098
```
11199
112100
### Step 2: Add `release.yml` to `.github/workflows/`
@@ -142,11 +130,11 @@ jobs:
142130
yq --version
143131
- name: Install gitmoji-semver
144132
run: |
145-
git clone https://github.com/nkmr-jp/gitmoji-semver -b v1.7.0
133+
git clone https://github.com/nkmr-jp/gitmoji-semver -b v2.0.0
146134
- name: Generate semantic-release configs
147135
working-directory: ./gitmoji-semver
148136
run: |
149-
make scaffold V=v3.0.0 F=../.semver.yml O=.. M=simple
137+
make scaffold F=../.semver.yml O=..
150138
- name: Release
151139
working-directory: ./.release
152140
env:

gen-release-template.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,8 @@ function run() {
3535
}
3636

3737
function buildTemplate(gitmojiObj) {
38-
if (process.argv[2] === "simple") {
39-
return `{{#if ${gitmojiObj.name.replace(/-/g, '_')}}} {{#each ${gitmojiObj.name.replace(/-/g, '_')}}}- {{> commitTemplate}}
38+
return `{{#if ${gitmojiObj.name.replace(/-/g, '_')}}} {{#each ${gitmojiObj.name.replace(/-/g, '_')}}}- {{> commitTemplate}}
4039
{{/each}}{{/if}}`
41-
} else {
42-
return `
43-
{{#if ${gitmojiObj.name.replace(/-/g, '_')}}}
44-
### ${gitmojiObj.emoji} ${gitmojiObj.description}
45-
{{#each ${gitmojiObj.name.replace(/-/g, '_')}}}
46-
- {{> commitTemplate}}
47-
{{/each}}
48-
{{/if}}
49-
`
50-
}
5140
}
5241

5342
run()

gitmoji-semver.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ const semverObj = JSON.parse(fs.readFileSync('./build/src/semver.json', 'utf8'))
55
function run() {
66
const res = {gitmojis: []};
77
for (const v of gitmojisObj.gitmojis) {
8-
v.semver = semver(v.name.replace(/-/g,'_'))
8+
if (v.semver === null){
9+
v.semver = "none"
10+
}
11+
let s = semver(v.name.replace(/-/g,'_'))
12+
if (s !== null){
13+
v.semver = s
14+
}
915
res.gitmojis.push(v)
1016
}
1117

@@ -18,7 +24,7 @@ function semver(name) {
1824
return v
1925
}
2026
}
21-
return 'none'
27+
return null
2228
}
2329

2430
run()

semantic-release-template/commit-template-default.hbs

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)