-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update some gh action script, add auto gen changelog config
- Loading branch information
Showing
5 changed files
with
98 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/gcli | ||
|
||
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: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
name: action-tests | ||
on: | ||
push: | ||
pull_request: | ||
paths: | ||
- 'go.mod' | ||
- '**.go' | ||
- '**.yml' | ||
push: | ||
paths: | ||
- 'go.mod' | ||
- '**.go' | ||
- '**.yml' | ||
|
||
jobs: | ||
|
||
|
@@ -13,22 +18,36 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go_version: [1.13, 1.14, 1.15, 1.16, 1.17] | ||
go_version: [1.15, 1.16, 1.17, 1.18] | ||
|
||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Check out codes | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Go ${{ matrix.go_version }} | ||
- name: Setup Go Faster | ||
uses: WillAbides/[email protected] | ||
timeout-minutes: 3 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
# id: go | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
- name: Revive check | ||
uses: morphy2k/[email protected] | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
with: | ||
# Exclude patterns, separated by semicolons (optional) | ||
exclude: "./internal/..." | ||
|
||
- name: Run staticcheck | ||
uses: reviewdog/action-staticcheck@v1 | ||
if: ${{ github.event_name == 'pull_request'}} | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review]. | ||
reporter: github-pr-check | ||
# Report all results. [added,diff_context,file,nofilter]. | ||
filter_mode: added | ||
# Exit with 1 when it find at least one finding. | ||
fail_on_error: true | ||
|
||
- name: Run tests | ||
run: go test -v -cover ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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 -c .github/changelog.yml -o changelog.md prev last | ||
# https://github.com/actions/create-release | ||
- uses: meeDamian/[email protected] | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# TODO | ||
|
||
- hook on set flag value | ||
- multi option aliases |