Skip to content

Commit fb141c4

Browse files
committed
up: update action, will auto generate changelog on release
1 parent 374b414 commit fb141c4

File tree

4 files changed

+76
-21
lines changed

4 files changed

+76
-21
lines changed

.github/changelog.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
title: '## Change Log'
2+
# style allow: simple, markdown(mkdown), ghr(gh-release)
3+
style: gh-release
4+
# group names
5+
names: [Refactor, Fixed, Feature, Update, Other]
6+
repo_url: https://github.com/gookit/color
7+
8+
filters:
9+
# message length should >= 12
10+
- name: msg_len
11+
min_len: 12
12+
# message words should >= 3
13+
- name: words_len
14+
min_len: 3
15+
- name: keyword
16+
keyword: format code
17+
exclude: true
18+
- name: keywords
19+
keywords: format code, action test
20+
exclude: true
21+
22+
# group match rules
23+
# not matched will use 'Other' group.
24+
rules:
25+
- name: Refactor
26+
start_withs: [refactor, break]
27+
contains: ['refactor:']
28+
- name: Fixed
29+
start_withs: [fix]
30+
contains: ['fix:']
31+
- name: Feature
32+
start_withs: [feat, new]
33+
contains: [feature]
34+
- name: Update
35+
start_withs: [update, 'up:']
36+
contains: [' update']

.github/dependabot.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
version: 2
22
updates:
3-
- package-ecosystem: gomod
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
3+
4+
- package-ecosystem: gomod
5+
directory: "/"
6+
schedule:
7+
interval: daily
8+
open-pull-requests-limit: 10
9+
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
# Check for updates to GitHub Actions every weekday
14+
interval: "daily"

.github/workflows/go.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,18 @@ jobs:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
17-
go_version: [1.13, 1.14, 1.15, 1.16, 1.17]
17+
go_version: [1.15, 1.16, 1.17, 1.18]
1818
os: [ubuntu-latest, windows-latest, macOS-latest]
1919

2020
steps:
2121
- name: Check out code
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323

24-
- name: Use Go ${{ matrix.go_version }}
25-
timeout-minutes: 5
26-
uses: actions/setup-go@v2
24+
- name: Setup Go Faster
25+
uses: WillAbides/[email protected]
26+
timeout-minutes: 3
2727
with:
2828
go-version: ${{ matrix.go_version }}
29-
# id: go
3029

3130
- name: Display Env
3231
# run: env | grep -i term # error on exec

.github/workflows/release.yml

+23-10
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,39 @@ jobs:
1313
strategy:
1414
fail-fast: true
1515
matrix:
16-
go: [1.16]
16+
go_version: [1.17]
1717

1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Setup Go Faster
25+
uses: WillAbides/[email protected]
26+
timeout-minutes: 3
27+
with:
28+
go-version: ${{ matrix.go_version }}
2129

2230
- name: Setup ENV
2331
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
2432
run: |
2533
echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
2634
echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV
2735
28-
- name: Display Env
29-
run: env
36+
- name: Generate changelog
37+
run: |
38+
go install github.com/gookit/gitw/cmd/chlog@latest
39+
chlog -config .github/changelog.yml -output changelog.md prev last
3040
31-
# https://github.com/actions/create-release
32-
- uses: meeDamian/[email protected]
41+
# https://github.com/softprops/action-gh-release
42+
- name: Create release and upload assets
43+
uses: softprops/action-gh-release@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3346
with:
34-
gzip: false
35-
token: ${{ secrets.GITHUB_TOKEN }}
36-
tag: ${{ env.RELEASE_TAG }}
3747
name: ${{ env.RELEASE_TAG }}
38-
# files: kite-${{ env.RELEASE_TAG }}.phar
48+
tag_name: ${{ env.RELEASE_TAG }}
49+
body_path: changelog.md
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
# files: macos-chlog.exe

0 commit comments

Comments
 (0)