Skip to content

Commit

Permalink
👔 up: update github action scripts
Browse files Browse the repository at this point in the history
- will not test on go < 1.18
  • Loading branch information
inhere committed Dec 16, 2022
1 parent 635b210 commit 12e6d2e
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 12 deletions.
37 changes: 37 additions & 0 deletions .github/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
title: '## Change Log'
# style allow: simple, markdown(mkdown), ghr(gh-release)
style: gh-release
# group names
names: [Refactor, Fixed, Feature, Update, Other]
# if empty will auto fetch by git remote
#repo_url: https://github.com/gookit/goutil

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, 'feat:']
- name: Update
start_withs: [up]
contains: ['update:', 'up:']
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go_version: [1.19, 1.16, 1.17, 1.18]
go_version: [1.19, 1.18]
os: [ubuntu-latest, macOS-latest]

steps:
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,33 @@ jobs:
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
go: [1.17]

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

- 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: |
curl https://github.com/gookit/gitw/releases/latest/download/chlog-linux-amd64 -L -o /usr/local/bin/chlog
chmod a+x /usr/local/bin/chlog
chlog -c .github/changelog.yml -o changelog.md prev last
# https://github.com/actions/create-release
- uses: meeDamian/github-release@v2.0.3
# 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
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module github.com/gookit/event

go 1.15
go 1.18

require github.com/stretchr/testify v1.8.0

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

0 comments on commit 12e6d2e

Please sign in to comment.