Files
PVE-Tools-9/.github/workflows/release.yml
Maple c932028f5b chore: update docs, images, CI configs and script initialization hints
- lib/core.sh: update script initialization prompts
- intel-sriov/intel-legacy/intel-gvtg/nvidia: minor refinements
- Docs: update README, CLAUDE.md and images
- CI: sync beta-release and release workflow configs
- self-update: update version check logic
2026-07-08 14:36:37 +08:00

73 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Release to Main
on:
push:
tags:
- 'v*.*.*'
- '*.*.*'
- 'v*.*.*-stable'
- '*.*.*-stable'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # 获取所有历史以生成changelog
- name: Get version from tag
id: get_version
run: |
TAG=${GITHUB_REF#refs/tags/}
VERSION=${TAG#v}
echo "TAG=$TAG" >> $GITHUB_OUTPUT
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Build single script from modules
run: bash build.sh
- name: Generate release notes
id: release_notes
run: |
# 生成基于提交历史的发布说明
LATEST_TAG=${{ steps.get_version.outputs.TAG }}
# 尝试获取前一个 tag如果没有则为空
PREVIOUS_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null || echo "")
if [ -z "$PREVIOUS_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"- %s (%an)" $LATEST_TAG)
else
CHANGELOG=$(git log --pretty=format:"- %s (%an)" $PREVIOUS_TAG..$LATEST_TAG)
fi
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.TAG }}
name: Release ${{ steps.get_version.outputs.TAG }}
body: |
## 版本 ${{ steps.get_version.outputs.VERSION }}
### 更新日志
${{ steps.release_notes.outputs.CHANGELOG }}
### 使用方法
**直接运行脚本 (推荐)**
```bash
bash <(curl -sSL https://pve.u3u.icu/PVE-Tools.sh)
```
files: |
dist/PVE-Tools.sh
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}