Skip to content

Commit 4594abf

Browse files
authored
Update package_and_release.yml
1 parent c285498 commit 4594abf

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

.github/workflows/package_and_release.yml

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

61+
# 修复上传步骤 - 上传dist目录中的所有可执行文件
6162
- 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/*.exe
68-
asset_name: ${{ github.event.inputs.tag_name }}-binaries
69-
asset_content_type: application/octet-stream
63+
run: |
64+
$releaseTag = "${{ github.event.inputs.tag_name }}"
65+
$uploadUrl = "${{ steps.create_release.outputs.upload_url }}"
66+
67+
# 获取所有可执行文件
68+
$exeFiles = Get-ChildItem -Path .\dist -Recurse -Filter *.exe
69+
70+
foreach ($file in $exeFiles) {
71+
$fileName = $file.Name
72+
$filePath = $file.FullName
73+
74+
Write-Host "Uploading: $fileName"
75+
76+
# 使用curl上传文件
77+
curl.exe --request POST `
78+
--url "$uploadUrl?name=$fileName" `
79+
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" `
80+
--header "Content-Type: application/octet-stream" `
81+
--data-binary "@$filePath"
82+
}
83+
shell: pwsh

0 commit comments

Comments
 (0)