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