Files
PVE-Tools-9/.github/workflows/beta-release.yml

85 lines
2.7 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 Beta
on:
push:
tags:
- 'v*.*.*-beta*'
- '*.*.*-beta*'
- 'v*.*.*-alpha*'
- '*.*.*-alpha*'
permissions:
contents: write
jobs:
beta-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- 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: Validate build output before release
run: |
# beta 同样不跳过构建质量校验版本号断言放宽beta 标签允许与 config 不同步)
bash -n dist/PVE-Tools.sh
shellcheck --severity=error -f gcc dist/PVE-Tools.sh
diff <(grep -rhoE '^[a-zA-Z_][a-zA-Z0-9_]*\(\)' lib src/modules --include='*.sh' | sort -u) \
<(grep -hoE '^[a-zA-Z_][a-zA-Z0-9_]*\(\)' dist/PVE-Tools.sh | sort -u) \
|| { echo "构建产物与源码函数集合不一致,中止发布"; exit 1; }
- name: Generate checksums
run: |
cd dist && sha256sum PVE-Tools.sh > SHA256SUMS.txt && cat SHA256SUMS.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.TAG }}
name: Beta Release ${{ steps.get_version.outputs.TAG }}
body: |
## Beta 版本 ${{ steps.get_version.outputs.VERSION }}
⚠️ 这是测试版本,可能存在不稳定因素,请勿在生产环境使用
## 安装方式
**Cloudflare 短域名(推荐)**
```bash
bash <(curl -sSL https://pve.u3u.icu/PVE-Tools.sh)
```
**中国大陆网络**
```bash
bash <(curl -sSL https://ghfast.top/https://github.com/PVE-Tools/PVE-Tools-9/releases/latest/download/PVE-Tools.sh)
```
**国际网络**
```bash
bash <(curl -sSL https://github.com/PVE-Tools/PVE-Tools-9/releases/latest/download/PVE-Tools.sh)
```
**本地下载运行**
```bash
wget https://github.com/PVE-Tools/PVE-Tools-9/releases/latest/download/PVE-Tools.sh
chmod +x PVE-Tools.sh
sudo ./PVE-Tools.sh
```
files: |
dist/PVE-Tools.sh
dist/SHA256SUMS.txt
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}