Skip to content

Commit

Permalink
fix: 更新配置
Browse files Browse the repository at this point in the history
  • Loading branch information
zoujingli committed Aug 4, 2024
1 parent c162cde commit da5ef7c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
29 changes: 12 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,28 @@ jobs:
id: last_tag
run: |
# 获取所有标签,按版本排序(降序)
Tags=$(git tag --list --sort=-version:refname)
# 获取倒数第一个标签
FRIEST_LATEST_TAG=$(echo "$Tags" | awk 'NR==1 {print $1; exit}')
# 获取最新的标签(即列表中的第一个)
LATEST_TAG=$(echo "$Tags" | awk 'NR==1 {print $1; exit}')
# 获取倒数第二个标签
SECOND_LATEST_TAG=$(echo "$Tags" | awk 'NR==1 {print $2; exit}')
# 如果没有倒数第一个标签,则输出为空字符串
if [[ -z "$FRIEST_LATEST_TAG" ]]; then
echo "::set-output name=tag_last::v1.0.0"
# 获取倒数第二个标签(如果存在)
if [[ -n "$Tags" ]]; then
SECOND_LATEST_TAG=$(echo "$Tags" | tac | awk 'NR==1 {print $1; exit}')
else
echo "::set-output name=tag_last::$FRIEST_LATEST_TAG"
fi
# 如果没有倒数第二个标签,则输出为空字符串
if [[ -z "$SECOND_LATEST_TAG" ]]; then
echo "::set-output name=tag_cmd::-S master"
else
echo "::set-output name=tag_cmd::-S $SECOND_LATEST_TAG"
SECOND_LATEST_TAG=""
fi
# 设置输出变量
echo "::set-output name=tag_last::${LATEST_TAG:-v1.0.0}"
echo "::set-output name=tag_cmd::-S ${SECOND_LATEST_TAG:-v1.0.0} "
- name: Generate Release Notes
run: |
rm -rf log
newTag=${{ steps.last_tag.outputs.tag_last }}
git-log -m tag -f ${{ steps.last_tag.outputs.tag_cmd }} -v ${newTag#v}
git-log -m tag -f ${{ steps.last_tag.outputs.tag_cmd }}-v ${newTag#v}
- name: Create Release
id: create_release
Expand Down
4 changes: 3 additions & 1 deletion bin/clearTag.cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@echo off
setlocal

git pull

echo Deleting remote tags...
for /f "delims=" %%x in ('git tag') do git push --delete origin %%x
for /f "delims=" %%x in ('git tag') do git push --delete origin %%x

echo Deleting local tags...
for /f "delims=" %%i in ('git tag') do git tag -d %%i
Expand Down

0 comments on commit da5ef7c

Please sign in to comment.