Update flutter-build.yml

1. Change Nightly release to official release.
2. Fix executable file upload code.

1.将Nightly发布改为正式发布。
2.修复可执行文件上传代码。
This commit is contained in:
LittleFishYu2008 2025-05-23 17:58:54 +08:00
parent 27800b2566
commit bf4c166cee

View File

@ -561,52 +561,55 @@ jobs:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./source-artifact
path: ${{ github.workspace }}/source-artifact
pattern: windows-*
- name: Extract and Flatten Files
run: |
# 创建目标目录
mkdir -p ./unpacked
# 递归查找所有层级的 ZIP 文件(含子目录)
find ./source-artifact -type f -iname "*.zip" -print0 | while IFS= read -r -d $'\0' zipfile; do
echo "🔍 发现 ZIP 文件: $zipfile"
# 创建唯一临时目录
mkdir -p ${{ github.workspace }}/unpacked
# 递归查找所有 ZIP 文件
find ${{ github.workspace }}/source-artifact/windows-sciter-artifacts -type f -name "*.zip" -print0 | while IFS= read -r -d '' zipfile; do
echo "Processing: $zipfile"
# 创建临时解压目录
TEMP_DIR=$(mktemp -d)
echo "🔄 临时目录: $TEMP_DIR"
# 解压到临时目录
if ! unzip -oq "$zipfile" -d "$TEMP_DIR"; then
echo "❌ 解压失败: $zipfile"
exit 1
fi
# 移动所有文件到根目录(包含子目录中的文件)
find "$TEMP_DIR" -type f -exec mv -f "{}" ./unpacked/ \;
# 解压到临时目录(保留原始结构)
unzip -oq "$zipfile" -d "$TEMP_DIR"
# 递归查找所有文件(排除目录)并移动到目标目录
find "$TEMP_DIR" -type f -exec mv -f "{}" ${{ github.workspace }}/unpacked/ \;
# 清理临时目录
rm -rf "$TEMP_DIR"
done
# 递归查找所有 ZIP 文件
find ${{ github.workspace }}/source-artifact/windows-flutter-artifacts -type f -name "*.zip" -print0 | while IFS= read -r -d '' zipfile; do
echo "Processing: $zipfile"
# 创建临时解压目录
TEMP_DIR=$(mktemp -d)
# 解压到临时目录(保留原始结构)
unzip -oq "$zipfile" -d "$TEMP_DIR"
# 递归查找所有文件(排除目录)并移动到目标目录
find "$TEMP_DIR" -type f -exec mv -f "{}" ${{ github.workspace }}/unpacked/ \;
# 清理临时目录
rm -rf "$TEMP_DIR"
done
# 验证最终结果
echo "✅ 最终文件列表:"
find ./unpacked -type f -exec ls -l "{}" \;
find ${{ github.workspace }}/unpacked -type f -exec ls -l "{}" \;
- name: Validate Paths
run: |
echo "工作区路径: ${{ github.workspace }}"
echo "解压目录绝对路径: $(realpath ./unpacked)"
echo "解压目录绝对路径: $(realpath ${{ github.workspace }}/unpacked)"
echo "上传路径验证:"
du -sh ./unpacked
du -sh ${{ github.workspace }}/unpacked
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
prerelease: true
tag_name: ${{ env.TAG_NAME }}
name: "${{ env.TAG_NAME }} Build ${{ steps.gen_notes.outputs.timestamp }}"
body: ${{ steps.gen_notes.outputs.notes }}
files: |
./unpacked/*
${{ github.workspace }}/unpacked/rustdesk-${{ env.VERSION }}-x86_64.exe
${{ github.workspace }}/unpacked/rustdesk-${{ env.VERSION }}-x86_64.msi
${{ github.workspace }}/unpacked/rustdesk-${{ env.VERSION }}-x86-sciter.exe