Skip to content

Releases: jzovvo/releaseter

230521 22:08:09

21 May 14:09
1213438
Compare
Choose a tag to compare

🚀 Features

  • 加入排除關鍵字的配置 (fix #24) #25

  • feat: 加入排除 lable 的選項配置 (fix #7, #8) #28

🐛 Bug Fixes

  • fix: 修正 label 符合時應該要跳出循環找下一個 pull #26

230511 12:18:47

11 May 04:19
fbc6947
Compare
Choose a tag to compare

🚀 Features

  • feat: 更新 view 排版 #22

  • Feat: 排除 Release 以重置 "最新" Release 的時間 (fix #20) #21

🐛 Bug Fixes

  • 如果 other 沒有匹配到東西,就不應該出現 #16

230510 00:01:51

09 May 16:04
58f4b0e
Compare
Choose a tag to compare

🐛 Bug Fixes


  • fix: 修正使用默認配置時無法匹配默認分類問題 #13

  • fix(dao): 拿掉 panic,無論如何都初始化一個 release 往下走 (fix #3) #11

OTHER


  • build(.github): 用自己的 action 來寫 draft #12

  • doc: ISSUE 模板內容更新 #4

  • doc: 新增 ISSUE 模板 #2

  • doc: 新增 PR 模板 #1

Releaster - An Automated Release Draft Generation Tool

06 May 19:25
Compare
Choose a tag to compare

Releaseter is a GitHub Action that helps users generate release drafts from the latest release to the latest pull request. This tool is inspired by the configuration file of release-drafter/release-drafter.

Usage

To use Releaseter, simply add it as a step in your GitHub Action workflow:

name: example
on:
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
      contents: write
    steps:
      - uses: actions/checkout@v3
      - uses: JZGoopi/releaseter@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

When using Releaseter, make sure to pass in the github-token and grant it pull-requests and contents write permissions.

Customization

Releaseter can be customized by creating a configuration file. By default, Releaseter will look for a .github/releaseter.yml file for configuration. To specify a different file path, use the config-path input:

      - uses: JZGoopi/releaseter@v1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          config-path: 'apple/banana.yml'

This will cause Releaseter to look for a configuration file at .github/apple/banana.yml.

Configuration File Template

The following is an example configuration file for Releaseter:

name-template: '{{ $TIME_WORKFLOW }}'

tag-template: 'v{{ $VERSION_NEXT_PATCH }}'
tag-preRelease: ""
tag-build: ""

categories:
  - title: '🚀 Features'
    labels:
      - 'feature'
      - 'feat'
  - title: '🐛 Bug Fixes'
    labels:
      - 'fix'
      - 'bugfix'
      - 'bug'

category-other:
  show: true
  title: 'OTHERRR'

clear-history-draft: true

time-format: '06/01/02 15:04:05'
time-location: 'Asia/Taipei'

The name-template is the template for the release title. It supports several placeholders and defaults to {{ $TIME_WORKFLOW }}.

The tag-template is the template for the tag. It also supports several placeholders and defaults to v{{ $VERSION_NEXT_PATCH }}.

Both name-template and tag-template support the following placeholders:

  • {{ $VERSION_NEXT_MAJOR }}: the next major version
  • {{ $VERSION_NEXT_MINOR }}: the next minor version
  • {{ $VERSION_NEXT_PATCH }}: the next patch version
  • {{ $TIME_WORKFLOW }}: the time when the workflow is run
  • {{ $EMPTY }}: an empty string
  • The version numbers follow Semantic Versioning 2.0.0 as defined by GitHub, and Releaseter will use the latest tag that matches the tag-template as a baseline.

tag-preRelease and tag-build are pre-release and build tags for Semantic Versioning 2.0.0, respectively. They default to an empty string.

categories is an array of categories, each with a title and a list of labels. If a pull request's labels match any of the specified labels, its title will be added to the corresponding category. The format will be:

### Category Title
---
- PR1
- PR2

category-other controls whether to include pull requests that do not match any of the specified labels. It has two keys:

  • show: A boolean value that determines whether to include unmatched pull requests. The default value is false.
  • title: The title for the section that includes unmatched pull requests. The default value is 'OTHER'.

clear-history-draft controls whether to clear existing drafts. It defaults to false.

time-format is the format for the time. It uses Golang's placeholder syntax and defaults to '060102 15:04:05'. The available placeholders are:

  • Year:
    • 2006: four-digit year
    • 06: two-digit year
  • Month:
    • 1 or 01: numeric month
    • Jan: abbreviated month name
  • Day: 2 or 02
  • Hour:
    • 3: 12-hour clock hour
    • 15: 24-hour clock hour
  • Minute: 4 or 04
  • Second:
    • 5 or 05
    • 5.000000: decimal fraction of a second
  • Timezone:
    • MST: Mountain Standard Time
    • UTC: Coordinated Universal Time
    • EST: Eastern Standard Time
    • CST: Central Standard Time
    • PST: Pacific Standard Time
    • -0700: numeric timezone offset from UTC (e.g. -7 hours)
    • -07:00: numeric timezone offset from UTC with colon separator (e.g. -7:00)
  • Weekday:
    • Mon: abbreviated weekday name
    • Monday: full weekday name
  • AM/PM:
    • PM: uppercase AM/PM
    • pm: lowercase AM/PM

You can use these placeholders to format the time in the way that you prefer. For example, if you want to include the abbreviated weekday name and the timezone offset, you can use the following format:

time-format: 'Mon, Jan 02 2006 15:04:05 -0700'

This will produce a time string like Fri, May 07 2023 10:30:00 -0700, where Fri is the abbreviated weekday name, May 07 2023 is the date, 10:30:00 is the time, and -0700 is the timezone offset.

time-location Controls the timezone used for timestamps. The value must be a valid name from the IANA Time Zone database. The default value is 'Asia/Taipei'.

Conclusion

Releaseter is a helpful tool for generating release drafts from the latest release to the latest pull request. With its customizable configuration options, you can tailor it to your specific needs.