Skip to content

nkmr-jp/gitmoji-semver

Repository files navigation

English | ζ—₯本θͺž

πŸ˜„ gitmoji-semver πŸš€

License: MIT Gitmoji semantic-release

πŸ˜† Just commit with gitmoji, and you'll get auto versioning by semantic versioning and auto release to github.

Auto versioning and release to github (example)
image

How to auto release

Use GithubActions. Time required: 3 minutes

You only need to add two files, and you're ready to go. Feel free to try it out in your own Github Repository.

Step 1: Add .semver.yml to your Repository root

example: ./.semver.yml

# .semver.yml

# Release Branches
branches: [ master, main ]

# gitmoji semver settings
# You can override the default values to suit your project.
semver:
  #  minor:
  #    - lipstick
  #  patch:
  #    - art
  #  none: # gitmoji.json "semver": null is convert to none
  #    - pencil2
  ignore: # not add in release-template.hbs
    - construction

Step 2: Add release.yml to .github/workflows/

# .github/workflows/release.yml

name: Release
on:
  push:
    branches:
      - master
      - main
jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 20
      - name: Install jq yq
        run: |
          sudo wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O /usr/bin/jq &&\
          sudo chmod +x /usr/bin/jq
          sudo pip install yq
          jq --version
          yq --version
      - name: Install gitmoji-semver
        run: |
          git clone https://github.com/nkmr-jp/gitmoji-semver -b v2.0.5
      - name: Generate semantic-release configs
        working-directory: ./gitmoji-semver
        run: |
          make scaffold F=../.semver.yml O=..
      - name: Release
        working-directory: ./.release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          npm install
          npx semantic-release

Step 3: Commit and Push

git add .
git commit -m ":sparkles: Introduce new features."
git push

πŸŽ‰ Done! Check out the Release Page in your Github Repository.

How to use in Mac (option)

Install

Require curl, jq, yq and node command.

brew install curl yq jq

yq --version
# yq 2.10.1
jq --version
# jq-1.6
node --version
# v13.14.0 # Probably works in other versions too.

# Install
git clone https://github.com/nkmr-jp/gitmoji-semver

Usage

cd ./gitmoji-semver
make help

References