Skip to content

Commit 83298dc

Browse files
authored
Merge pull request #15 from nkmr-jp/develop
Develop
2 parents 9c25f24 + a01e50c commit 83298dc

File tree

8 files changed

+116
-173
lines changed

8 files changed

+116
-173
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: 9 additions & 19 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
@@ -55,17 +52,14 @@ gen:
5552

5653
@echo
5754
@echo
58-
@echo "$(PURPLE)# GEN: 2. Add semver field$(RESET)"
55+
@echo "$(PURPLE)# GEN: 2. Update semver field$(RESET)"
5956
yq '.' $(SEMVER_FILE) > build/src/semver.json
6057
node gitmoji-semver.js
61-
cat build/dist/tmp.json | jq > build/dist/gitmojis.json
62-
yq -y '.' build/dist/gitmojis.json > build/dist/gitmojis.yml
63-
rm build/dist/tmp.json
6458

6559
@echo
6660
@echo
67-
@echo "$(PURPLE)# GEN: 3. Generated!$(RESET)"
68-
@echo "Generated gitmojis.json and gitmojis.yml with semver field"
61+
@echo "$(PURPLE)# GEN: 4. Generated!$(RESET)"
62+
@echo "Generated gitmojis.json and semver.json"
6963
@echo "See ./build/dist"
7064

7165
@echo
@@ -91,17 +85,13 @@ list:
9185
scaffold: gen
9286
@echo
9387
@echo "$(PURPLE)# SCAFFOLD: Generate semantic-release setting files$(RESET)"
94-
node gen-release-template.js $(TEMPLATE_TYPE)
88+
node gen-release-template.js
9589
mkdir -p $(OUT_DIR)/.release
9690
cp -a ./semantic-release-template/. $(OUT_DIR)/.release
9791
cp ./build/dist/release-template.hbs $(OUT_DIR)/.release
9892
cp ./build/dist/gitmojis.json $(OUT_DIR)/.release
99-
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
93+
cp ./build/dist/semver.json $(OUT_DIR)/.release
94+
10595
@echo
10696
@echo "$(LIGHTPURPLE)🎉 Add semantic-release setting files$(RESET)"
10797
@echo $(OUT_DIR)/.release

README.md

Lines changed: 39 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
<h1 align="center">Welcome to gitmoji-semver 👋</h1>
2-
3-
<p align="center">
4-
<a href="#" target="_blank">
5-
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
6-
</a>
7-
<a href="https://gitmoji.carloscuesta.me">
8-
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square" alt="Gitmoji">
9-
</a>
10-
<a href="https://github.com/semantic-release/semantic-release">
11-
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" alt="semantic-release">
12-
</a>
13-
</p>
14-
1+
<h1>gitmoji-semver</h1>
2+
3+
<a href="#" target="_blank">
4+
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
5+
</a>
6+
<a href="https://gitmoji.carloscuesta.me">
7+
<img src="https://img.shields.io/badge/gitmoji-%20😜%20😍-FFDD67.svg?style=flat-square" alt="Gitmoji">
8+
</a>
9+
<a href="https://github.com/semantic-release/semantic-release">
10+
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" alt="semantic-release">
11+
</a>
1512

1613
<!-- @import "[TOC]" {cmd="toc" depthFrom=1 depthTo=6 orderedList=false} -->
1714

1815
<!-- code_chunk_output -->
1916

2017
- [Features](#features)
21-
- [Release template type](#release-template-type)
18+
- [Release template type](#release-template-type)
2219
- [How to use in Mac](#how-to-use-in-mac)
23-
- [Install](#install)
24-
- [Usage](#usage)
20+
- [Install](#install)
21+
- [Usage](#usage)
2522
- [How to auto release ( using GithubActions. only 3 minutes )](#how-to-auto-release--using-githubactions-only-3-minutes-)
26-
- [Step 1: Add `.semver.yml` to your Repository root](#step-1-add-semveryml-to-your-repository-root)
27-
- [Step 2: Add `release.yml` to `.github/workflows/`](#step-2-add-releaseyml-to-githubworkflows)
28-
- [Step 3: Commit and Push](#step-3-commit-and-push)
29-
- [If you want to run locally](#if-you-want-to-run-locally)
23+
- [Step 1: Add `.semver.yml` to your Repository root](#step-1-add-semveryml-to-your-repository-root)
24+
- [Step 2: Add `release.yml` to `.github/workflows/`](#step-2-add-releaseyml-to-githubworkflows)
25+
- [Step 3: Commit and Push](#step-3-commit-and-push)
26+
- [If you want to run locally](#if-you-want-to-run-locally)
3027
- [References](#references)
3128
- [Author](#author)
3229
- [Show your support](#show-your-support)
@@ -35,22 +32,20 @@
3532

3633
## Features
3734

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

42-
### Release template type
43-
44-
| 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)) |
45-
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
46-
| ![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)
4742

4843
## How to use in Mac
4944

5045
### Install
5146

5247
Require `curl`, `jq`, `yq` and `node` command.
53-
48+
5449
```sh
5550
brew install curl yq jq
5651

@@ -76,7 +71,8 @@ make help
7671

7772
## How to auto release ( using GithubActions. only 3 minutes )
7873

79-
The following steps will auto release with gitmoji using GithubActions. You only need to add two files, and you're ready to go. Feel free to try it out in your own Github Repository.
74+
The following steps will auto release with gitmoji using GithubActions. You only need to add two
75+
files, and you're ready to go. Feel free to try it out in your own Github Repository.
8076

8177
### Step 1: Add `.semver.yml` to your Repository root
8278

@@ -88,23 +84,17 @@ example: [./.semver.yml](.semver.yml)
8884
# Release Branches
8985
branches: [ master, main ]
9086

91-
# gitmoji semver settings (default is none)
87+
# gitmoji semver settings
88+
# You can override the default values to suit your project.
9289
semver:
93-
major:
94-
- boom # Introduce breaking changes.
95-
minor:
96-
- sparkles # Introduce new features.
97-
patch:
98-
- bug # Fix a bug.
99-
- ambulance # Critical hotfix.
100-
- green_heart # Fix CI Build.
101-
- construction_worker # Add or update CI build system.
102-
none:
103-
- memo # Add or update documentation.
104-
105-
# Prevents it from appearing in Github's Release.
106-
ignore:
107-
- 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
10898
```
10999
110100
### Step 2: Add `release.yml` to `.github/workflows/`
@@ -140,11 +130,11 @@ jobs:
140130
yq --version
141131
- name: Install gitmoji-semver
142132
run: |
143-
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
144134
- name: Generate semantic-release configs
145135
working-directory: ./gitmoji-semver
146136
run: |
147-
make scaffold V=v3.0.0 F=../.semver.yml O=.. M=simple
137+
make scaffold F=../.semver.yml O=..
148138
- name: Release
149139
working-directory: ./.release
150140
env:
@@ -182,14 +172,3 @@ act -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 # ※ 16GB docker image
182172
- [Semantic Versioning 2.0.0 | Semantic Versioning](https://semver.org/)
183173
- [Introduction to SemVer](https://blog.greenkeeper.io/introduction-to-semver-d272990c44f2)
184174

185-
## Author
186-
187-
👤 **nkmr-jp**
188-
189-
## Show your support
190-
191-
Give a ⭐️ if this project helped you!
192-
193-
***
194-
_This README was generated with ❤️
195-
by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

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()

0 commit comments

Comments
 (0)