From cf63663781d5ad7c7cd56a1d8af921357b4435f5 Mon Sep 17 00:00:00 2001 From: "Matt.Ma" Date: Tue, 9 Sep 2025 15:55:58 +0800 Subject: [PATCH] update github actions --- .github/workflows/release.yaml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b3228c2..85ddc8c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,7 @@ permissions: on: push: tags: - - 'v*' # 例如 v1.0.0 + - 'v*' # 例如 v1.0.0 jobs: build: @@ -35,7 +35,7 @@ jobs: run: | echo "Runner OS: ${{ runner.os }}" - # 根据平台设置系统名和扩展名 + # 设置系统名和扩展名 if [[ "${{ runner.os }}" == "Windows" ]]; then SYSNAME=windows EXT=.exe @@ -47,20 +47,22 @@ jobs: EXT= fi - # 用 PyInstaller 打包 + # 打包 pyinstaller --onefile rsync-tui.py - # 带系统名和 tag 重命名 + # 获取 tag 名 TAG_NAME=${GITHUB_REF##*/} + + # 重命名可执行文件 mv dist/rsync-tui${EXT} dist/rsync-tui-${SYSNAME}-${TAG_NAME}${EXT} - # 显示结果 + # 显示 dist 内容 ls -l dist - name: Upload build artifact uses: actions/upload-artifact@v4 with: - name: rsync-tui-${{ runner.os }} + name: rsync-tui path: dist/rsync-tui-* release: @@ -70,11 +72,19 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v4 with: + name: rsync-tui path: dist + - name: Prepare files for release + shell: bash + run: | + mkdir -p dist-root + cp dist/* dist-root/ + ls -l dist-root + - name: Create Release uses: softprops/action-gh-release@v2 with: - files: dist/rsync-tui-* + files: dist-root/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file