Skip to content

Commit

Permalink
up: update action, will auto generate changelog on release
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed May 19, 2022
1 parent 374b414 commit fb141c4
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 21 deletions.
36 changes: 36 additions & 0 deletions .github/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
title: '## Change Log'
# style allow: simple, markdown(mkdown), ghr(gh-release)
style: gh-release
# group names
names: [Refactor, Fixed, Feature, Update, Other]
repo_url: https://github.com/gookit/color

filters:
# message length should >= 12
- name: msg_len
min_len: 12
# message words should >= 3
- name: words_len
min_len: 3
- name: keyword
keyword: format code
exclude: true
- name: keywords
keywords: format code, action test
exclude: true

# group match rules
# not matched will use 'Other' group.
rules:
- name: Refactor
start_withs: [refactor, break]
contains: ['refactor:']
- name: Fixed
start_withs: [fix]
contains: ['fix:']
- name: Feature
start_withs: [feat, new]
contains: [feature]
- name: Update
start_withs: [update, 'up:']
contains: [' update']
17 changes: 12 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
11 changes: 5 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go_version: [1.13, 1.14, 1.15, 1.16, 1.17]
go_version: [1.15, 1.16, 1.17, 1.18]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Go ${{ matrix.go_version }}
timeout-minutes: 5
uses: actions/setup-go@v2
- name: Setup Go Faster
uses: WillAbides/setup-go-faster@v1.7.0
timeout-minutes: 3
with:
go-version: ${{ matrix.go_version }}
# id: go

- name: Display Env
# run: env | grep -i term # error on exec
Expand Down
33 changes: 23 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,39 @@ jobs:
strategy:
fail-fast: true
matrix:
go: [1.16]
go_version: [1.17]

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Go Faster
uses: WillAbides/setup-go-faster@v1.7.0
timeout-minutes: 3
with:
go-version: ${{ matrix.go_version }}

- name: Setup ENV
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
run: |
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
- name: Display Env
run: env
- name: Generate changelog
run: |
go install github.com/gookit/gitw/cmd/chlog@latest
chlog -config .github/changelog.yml -output changelog.md prev last
# https://github.com/actions/create-release
- uses: meeDamian/github-release@2.0
# https://github.com/softprops/action-gh-release
- name: Create release and upload assets
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
gzip: false
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_TAG }}
# files: kite-${{ env.RELEASE_TAG }}.phar
tag_name: ${{ env.RELEASE_TAG }}
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
# files: macos-chlog.exe

0 comments on commit fb141c4

Please sign in to comment.