Skip to content

Commit

Permalink
✨ feat: build changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
nichuanfang committed Oct 13, 2023
1 parent 9c5d14d commit 77c96e9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 63 deletions.
83 changes: 21 additions & 62 deletions .github/workflows/release_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,70 +58,29 @@ jobs:
python setup.py sdist bdist_wheel
twine upload dist/*
# # 生成发行说明
# - name: Generate Release Notes
# id: gen_release_notes
# uses: actions/github-script@v3
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# with:
# script: |
# const compareCommits = await github.repos.compareCommits({
# owner: context.repo.owner,
# repo: context.repo.repo,
# base: context.payload.before,
# head: context.payload.after
# });
# const commits = compareCommits.data.commits.map(commit => `- ${commit.commit.message}`);
# return commits.join('\n');

# # 将发行说明写入文件 该文件会在后面的步骤中使用
# - name: Write Release Notes
# id: write_release_notes
# run: |
# echo "release_notes=${{ steps.gen_release_notes.outputs.result }}" >> "$GITHUB_OUTPUT"

# 创建tag
# - name: Create Tag
# id: create_tag
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "jaychouzzz"
# git tag -a v${{ steps.get_version.outputs.version }} -m "v${{ steps.get_version.outputs.version }}"
# git push origin v${{ steps.get_version.outputs.version }}

- name: 'Build Changelog'
id: build_changelog
uses: mikepenz/[email protected]
with:
configurationJson: |
{
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feat"]
},
{
"title": "## 🐛 Fixes",
"labels": ["fix"]
},
{
"title": "## 🧪 Tests",
"labels": ["test"]
},
{
"title": "## 💬 Other",
"labels": ["init","docs","style","build","ci","chore"]
},
{
"title": "## 📦 Dependencies",
"labels": ["dependencies"]
}
]
}
# 生成发行说明
- name: Generate Release Notes
id: gen_release_notes
uses: actions/github-script@v3
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
script: |
const compareCommits = await github.repos.compareCommits({
owner: context.repo.owner,
repo: context.repo.repo,
base: context.payload.before,
head: context.payload.after
});
const commits = compareCommits.data.commits.map(commit => `- ${commit.commit.message}`);
return commits.join('\n');
# 将发行说明写入文件 该文件会在后面的步骤中使用
- name: build changelog
id: build_changelog
run: |
# 按照提交内容分类
echo "changelog=$(echo "${{ steps.gen_release_notes.outputs.result }}" | grep -E '^\- (init|feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\(.+\))?: .{1,50}$')" >> "$GITHUB_OUTPUT"
# 创建release
- name: Create Release
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='music-tool-kit',
version='0.6.0',
version='0.6.1',
description='A tool kit for music download and clip',
long_description_content_type='text/markdown',
long_description=readme,
Expand Down

0 comments on commit 77c96e9

Please sign in to comment.