Skip to content

vios-onboarding/ars

Repository files navigation

Auto release solution (ARS)

  1. Dependencies
  2. Hooks
  3. Commitlint config
  4. Release-please config
  5. Conventional commit messages
  6. Bump version
  7. Fix release notes

Dependencies

$ yarn add -D husky @commitlint/{cli,config-conventional}  

Husky hooks

 npx husky install
 npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
 npx husky add .husky/pre-commit "echo 'some process ci/cd'" 

Commitlint config

⚠️ To file commitlint.config.js

module.exports = {extends: ['@commitlint/config-conventional']};

Release please configs

github workflow (action)

Have two jobs for build and bum version and release

on:
  push:
    branches:
      - main

permissions:
  contents: write
  pull-requests: write

name: Create release

jobs:
  build:
    name: Build pkg
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: Build
        run: |
          yarn -y && yarn build
      - name: Upload build
        uses: actions/upload-artifact@v3
        with:
          name: ars
          path: build
  release-please:
    name: Bump+CL+release
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Download build
        uses: actions/download-artifact@v3
        with:
          name: ars
      - uses: google-github-actions/release-please-action@v3
        with:
          release-type: node
          token: ${{secrets.GITHUB_TOKEN}}
          package-name: ars
          path: build/
          pull-request-title-pattern: "chore${scope}: to release${component} ${version}"

manifest

{
  ".": "1.0.0"
}

config

{
  "release-type": "node",
  "packages": {
    ".": {
      "changelog-path": "CHANGELOG.md",
      "release-type": "node",
      "bump-minor-pre-major": false,
      "bump-patch-for-minor-pre-major": false,
      "draft": false,
      "prerelease": false
    }
  },
  "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
}

Conventional commit message part:

Release Please assume you are using Conventional Commit messages.

The most important prefixes you should have in mind are:

fix: which represents bug fixes, and correlates to a SemVer patch.
feat: which represents a new feature, and correlates to a SemVer minor.
feat!:, or fix!:, refactor!:, etc., which represent a breaking change (indicated by the !) and will result in a SemVer major.

Examples

feat: adds v4 UUID to crypto

This adds support for v4 UUIDs to the library.

fix(utils): unicode no longer throws exception
  PiperOrigin-RevId: 345559154
  BREAKING-CHANGE: encode method no longer throws.
  Source-Link: googleapis/googleapis@5e0dcb2

feat(utils): update encode to support unicode
  PiperOrigin-RevId: 345559182
  Source-Link: googleapis/googleapis@e5eef86

The above commit message will contain:

  • an entry for the "adds v4 UUID to crypto" feature.
  • an entry for the fix "unicode no longer throws exception", along with a note that it's a breaking change.
  • an entry for the feature "update encode to support unicode"

Bump version

git commit -m "chore: release 2.0.0\n\nRelease-As: 2.0.0"

⚠️ A releasable unit is a commit to the branch with one of the following prefixes: "feat", "* fix*", and "deps". (A "chore" or "build" commit is not a releasable unit.)

Fix release notes (during merge PR, squash message, or amend commit)

BEGIN_COMMIT_OVERRIDE
feat: add ability to override merged commit message

fix: another message
chore: a third message
END_COMMIT_OVERRIDE

Зроблено з любов'ю

About

auto-release-solution

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •