chore: generate release note automatically
This commit is contained in:
parent
fb6a032872
commit
8d1251f128
2 changed files with 21 additions and 8 deletions
6
.github/genReleaseNote.sh
vendored
6
.github/genReleaseNote.sh
vendored
|
@ -18,15 +18,15 @@ if [ -z "$version_range" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "## What's Changed" > release.md
|
echo "## What's Changed" > release.md
|
||||||
git log --pretty=format:"* %s by @%an" --grep="^feat" $version_range | sort -f | uniq >> release.md
|
git log --pretty=format:"* %s by @%an" --grep="^feat" -i $version_range | sort -f | uniq >> release.md
|
||||||
echo "" >> release.md
|
echo "" >> release.md
|
||||||
|
|
||||||
echo "## BUG & Fix" >> release.md
|
echo "## BUG & Fix" >> release.md
|
||||||
git log --pretty=format:"* %s by @%an" --grep="^fix" $version_range | sort -f | uniq >> release.md
|
git log --pretty=format:"* %s by @%an" --grep="^fix" -i $version_range | sort -f | uniq >> release.md
|
||||||
echo "" >> release.md
|
echo "" >> release.md
|
||||||
|
|
||||||
echo "## Maintenance" >> release.md
|
echo "## Maintenance" >> release.md
|
||||||
git log --pretty=format:"* %s by @%an" --grep="^chore\|^docs" $version_range | sort -f | uniq >> release.md
|
git log --pretty=format:"* %s by @%an" --grep="^chore\|^docs\|^refactor" -i $version_range | sort -f | uniq >> release.md
|
||||||
echo "" >> release.md
|
echo "" >> release.md
|
||||||
|
|
||||||
echo "**Full Changelog**: https://github.com/MetaCubeX/Clash.Meta/compare/$version_range" >> release.md
|
echo "**Full Changelog**: https://github.com/MetaCubeX/Clash.Meta/compare/$version_range" >> release.md
|
||||||
|
|
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
|
@ -94,11 +94,6 @@ jobs:
|
||||||
run: echo "VERSION=alpha-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
run: echo "VERSION=alpha-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Set variables
|
|
||||||
if: ${{github.ref_name=='Beta'}}
|
|
||||||
run: echo "VERSION=beta-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Set variables
|
- name: Set variables
|
||||||
if: ${{github.ref_name=='Meta'}}
|
if: ${{github.ref_name=='Meta'}}
|
||||||
run: echo "VERSION=meta-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
run: echo "VERSION=meta-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||||
|
@ -267,6 +262,23 @@ jobs:
|
||||||
needs: [Build]
|
needs: [Build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Get tags
|
||||||
|
run: |
|
||||||
|
echo "CURRENTVERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
git fetch --tags
|
||||||
|
echo "PREVERSION=$(git describe --tags --abbrev=0 HEAD^)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Generate release notes
|
||||||
|
run: |
|
||||||
|
cp ./.github/genReleaseNote.sh ./
|
||||||
|
bash ./genReleaseNote.sh -v ${PREVERSION}...${CURRENTVERSION}
|
||||||
|
rm ./genReleaseNote.sh
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: artifact
|
name: artifact
|
||||||
|
@ -283,6 +295,7 @@ jobs:
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ github.ref_name }}
|
||||||
files: bin/*
|
files: bin/*
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
body_path: release.md
|
||||||
|
|
||||||
Docker:
|
Docker:
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
|
|
Loading…
Reference in a new issue