1 Commits

Author SHA1 Message Date
ec9cf435ca workflow
All checks were successful
Build and Release / build (push) Successful in 3m26s
2026-05-17 02:13:41 -05:00

View File

@@ -45,26 +45,8 @@ jobs:
run: | run: |
$releaseId = "${{ steps.create_release.outputs.release_id }}" $releaseId = "${{ steps.create_release.outputs.release_id }}"
$filePath = "target\release\tickr.exe" $filePath = "target\release\tickr.exe"
$uri = "https://gitea.whitlocktech.com/api/v1/repos/whitlocktech/tickr/releases/$releaseId/assets?name=tickr.exe" curl.exe `
-X POST `
$fileBytes = [System.IO.File]::ReadAllBytes((Resolve-Path $filePath)) -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" `
$boundary = [System.Guid]::NewGuid().ToString() -F "attachment=@$filePath" `
$LF = "`r`n" "https://gitea.whitlocktech.com/api/v1/repos/whitlocktech/tickr/releases/$releaseId/assets?name=tickr.exe"
$bodyLines = @(
"--$boundary",
"Content-Disposition: form-data; name=`"attachment`"; filename=`"tickr.exe`"",
"Content-Type: application/octet-stream",
"",
[System.Text.Encoding]::Latin1.GetString($fileBytes),
"--$boundary--"
)
$bodyBytes = [System.Text.Encoding]::Latin1.GetBytes($bodyLines -join $LF)
Invoke-RestMethod `
-Uri $uri `
-Method Post `
-Headers @{ Authorization = "token ${{ secrets.RELEASE_TOKEN }}" } `
-ContentType "multipart/form-data; boundary=$boundary" `
-Body $bodyBytes