Skip to content

Commit 5d66748

Browse files
authored
Update package_and_release.yml
1 parent 18b6c9b commit 5d66748

1 file changed

Lines changed: 17 additions & 26 deletions

File tree

.github/workflows/package_and_release.yml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,21 @@ jobs:
5858
draft: false
5959
prerelease: false
6060

61-
# 修复上传步骤 - 上传dist目录中的所有可执行文件
62-
# 修复上传步骤 - 正确处理URL模板问题
63-
- name: Upload Release Assets
64-
run: |
65-
$releaseTag = "${{ github.event.inputs.tag_name }}"
66-
$uploadUrl = "${{ steps.create_release.outputs.upload_url }}"
67-
68-
# 移除URL中的模板部分
69-
$uploadUrl = $uploadUrl -replace '\{\?.*\}', ''
70-
71-
# 获取所有可执行文件(包括子目录)
72-
$exeFiles = Get-ChildItem -Path .\dist -Recurse -Filter *.exe
61+
# - name: Upload Release Assets
62+
# uses: actions/upload-release-asset@v1
63+
# env:
64+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
# with:
66+
# upload_url: ${{ steps.create_release.outputs.upload_url }}
67+
# asset_path: ./dist/
68+
# asset_name: ${{ github.event.inputs.tag_name }}-binaries
69+
# asset_content_type: application/octet-stream
7370

74-
foreach ($file in $exeFiles) {
75-
$fileName = $file.Name
76-
$filePath = $file.FullName
77-
78-
Write-Host "Uploading: $fileName"
79-
80-
# 使用curl上传文件
81-
curl.exe --request POST `
82-
--url "$uploadUrl?name=$fileName" `
83-
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" `
84-
--header "Content-Type: application/octet-stream" `
85-
--data-binary "@$filePath"
86-
}
87-
shell: pwsh
71+
- name: Upload Release Assets
72+
uses: xresloader/upload-to-github-release@main
73+
env:
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
with:
76+
file: "./dist/*.exe"
77+
release_id: ${{ steps.create_release.outputs.id }}
78+
verbose: true

0 commit comments

Comments
 (0)