Skip to content

Commit

Permalink
fix: 更新模板
Browse files Browse the repository at this point in the history
  • Loading branch information
zoujingli committed Aug 3, 2024
1 parent 38748c3 commit 419e851
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 72 deletions.
31 changes: 0 additions & 31 deletions .github/release-drafter.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/release-drafter.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Release
permissions: write-all

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for changelog generation
- name: Get last tag
id: last_tag
run: |
echo "::set-output name=tag::$(git describe --tags --abbrev=0 $(git rev-list --tags --max-count=1))"
- name: Generate changelog
id: changelog
run: |
# Initialize changelog variables
FEAT=""
FIX=""
DOCS=""
OTHER=""
# Generate changelog by parsing commit messages
git log ${{ steps.last_tag.outputs.tag }}..HEAD --pretty=format:"%s" | while read line; do
if [[ $line == feat:* ]]; then
FEAT="${FEAT}- ${line#feat: }\n"
elif [[ $line == fix:* ]]; then
FIX="${FIX}- ${line#fix: }\n"
elif [[ $line == docs:* ]]; then
DOCS="${DOCS}- ${line#docs: }\n"
else
OTHER="${OTHER}- $line\n"
fi
done
# Set changelog outputs
echo "::set-output name=feat::$FEAT"
echo "::set-output name=fix::$FIX"
echo "::set-output name=docs::$DOCS"
echo "::set-output name=other::$OTHER"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body: |
**Features**:
${{ steps.changelog.outputs.feat }}
**Fixes**:
${{ steps.changelog.outputs.fix }}
**Documentation**:
${{ steps.changelog.outputs.docs }}
**Other**:
${{ steps.changelog.outputs.other }}

0 comments on commit 419e851

Please sign in to comment.