mirror of
https://github.com/CodeSeeed/sbackup.git
synced 2026-10-02 18:32:58 +08:00
ci: Release 工作流读取 releases/v{version}.md 作为发布说明
This commit is contained in:
1 parent
8d7c31d36d
commit
6b881c4185
3 files changed
+141
No files matched your search
@@ -44,6 +44,23 @@ jobs:
|
||||
shell: bash
|
||||
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read release notes
|
||||
id: notes
|
||||
shell: bash
|
||||
run: |
|
||||
NOTES_FILE="releases/v${{ steps.version.outputs.VERSION }}.md"
|
||||
if [ -f "$NOTES_FILE" ]; then
|
||||
echo "HAS_NOTES=true" >> $GITHUB_OUTPUT
|
||||
# 使用 EOF 分隔符避免特殊字符问题
|
||||
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
|
||||
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "HAS_NOTES=false" >> $GITHUB_OUTPUT
|
||||
echo "NOTES=Release v${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build executable
|
||||
run: |
|
||||
python -m nuitka `
|
||||
@@ -64,6 +81,7 @@ jobs:
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body: ${{ steps.notes.outputs.NOTES }}
|
||||
files: sbackup-${{ steps.version.outputs.VERSION }}-windows-x64.exe
|
||||
|
||||
# 构建 macOS 可执行文件
|
||||
@@ -87,6 +105,21 @@ jobs:
|
||||
id: arch
|
||||
run: echo "ARCH=$(uname -m)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read release notes
|
||||
id: notes
|
||||
run: |
|
||||
NOTES_FILE="releases/v${{ steps.version.outputs.VERSION }}.md"
|
||||
if [ -f "$NOTES_FILE" ]; then
|
||||
echo "HAS_NOTES=true" >> $GITHUB_OUTPUT
|
||||
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
|
||||
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "HAS_NOTES=false" >> $GITHUB_OUTPUT
|
||||
echo "NOTES=Release v${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build executable
|
||||
run: |
|
||||
python -m nuitka \
|
||||
@@ -107,6 +140,7 @@ jobs:
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body: ${{ steps.notes.outputs.NOTES }}
|
||||
files: sbackup-${{ steps.version.outputs.VERSION }}-macos-${{ steps.arch.outputs.ARCH }}
|
||||
|
||||
# 构建 Linux 可执行文件
|
||||
@@ -130,6 +164,21 @@ jobs:
|
||||
id: arch
|
||||
run: echo "ARCH=$(uname -m)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read release notes
|
||||
id: notes
|
||||
run: |
|
||||
NOTES_FILE="releases/v${{ steps.version.outputs.VERSION }}.md"
|
||||
if [ -f "$NOTES_FILE" ]; then
|
||||
echo "HAS_NOTES=true" >> $GITHUB_OUTPUT
|
||||
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
|
||||
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "HAS_NOTES=false" >> $GITHUB_OUTPUT
|
||||
echo "NOTES=Release v${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build executable
|
||||
run: |
|
||||
python -m nuitka \
|
||||
@@ -150,4 +199,5 @@ jobs:
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
body: ${{ steps.notes.outputs.NOTES }}
|
||||
files: sbackup-${{ steps.version.outputs.VERSION }}-linux-${{ steps.arch.outputs.ARCH }}
|
||||
Reference in new issue
Block a user