5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GitHub Releases のリリースノートを自動生成する機能と renovate のプルリクを協調させとく

Posted at

TL;DR

  • GitHub Releases で、リリースノートを自動生成する機能が付いた
  • renovate は依存ライブラリの更新に必須だ
  • そこで、見やすいリリースノートを生成させる

renovate 設定

  • GitHub Actions で定期的に実行させる
  • RENOVATE_TOKEN は 適宜 pat で生成すること
    (残念 GITHUB_TOKEN は使えない)
..github/workflows/renovate.yml
name: renovate

on:
  schedule:
    - cron: "0 21 * * *"

jobs:
  renovate:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Self-hosted Renovate
        uses: renovatebot/github-action@v31.62.0
        with:
          configurationFile: .github/renovate.json
          token: ${{ secrets.RENOVATE_TOKEN }}
  • packageRules の matchUpdateTypes を使って 「Semantic Versioning」 のタイプ別にラベルを指定する
    • Update-Major
    • Update-Minor
    • Update-Patch
  • ドキュメント
..github/renovate.json
{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": [
    "config:base"
  ],
  "timezone": "Asia/Tokyo",
  "automerge": true,
  "packageRules": [
    {
      "matchUpdateTypes": [
        "major"
      ],
      "labels": [
        "Update-Major"
      ]
    },
    {
      "matchUpdateTypes": [
        "minor"
      ],
      "labels": [
        "Update-Minor"
      ]
    },
    {
      "matchUpdateTypes": [
        "patch"
      ],
      "labels": [
        "Update-Patch"
      ],
      "ignoreTests": true
    }
  ],
  "branchPrefix": "renovate/",
  "dryRun": false,
  "gitAuthor": "Renovate Bot <bot@renovateapp.com>",
  "onboarding": false,
  "platform": "github",
  "includeForks": true,
  "dependencyDashboard": true,
  "repositories": [
    "<OWNER>/<REPOSITORY>"
  ]
}

GitHub リリースノート の テンプレート

  • GitHub リリースノート は テンプレート でカスタマイズ可能
  • renovate が issue に付与した 「ラベル」 で分類するように
    • Update-Major
    • Update-Minor
    • Update-Patch
  • ドキュメント
..github/release.yml
changelog:
  exclude:
    labels:
      - ignore-for-release
    authors:
      - octocat
  categories:
    - title: Breaking Changes 🛠
      labels:
        - Update-Major
        - breaking-change
    - title: Exciting New Features 🎉
      labels:
        - Update-Minor
        - enhancement
    - title: Other Changes
      labels:
        - "*"

出来上がり

スクリーンショット 2022-01-30 19.19.50.png

あとがき

  • 寂しい一人プロジェクトでも、にぎやかなリリースノートさえあれば、これでモチベが爆上がりですね。
5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?