diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 71f3c2e..79f0eee 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -45,26 +45,8 @@ jobs: run: | $releaseId = "${{ steps.create_release.outputs.release_id }}" $filePath = "target\release\tickr.exe" - $uri = "https://gitea.whitlocktech.com/api/v1/repos/whitlocktech/tickr/releases/$releaseId/assets?name=tickr.exe" - - $fileBytes = [System.IO.File]::ReadAllBytes((Resolve-Path $filePath)) - $boundary = [System.Guid]::NewGuid().ToString() - $LF = "`r`n" - - $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 \ No newline at end of file + curl.exe ` + -X POST ` + -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" ` + -F "attachment=@$filePath" ` + "https://gitea.whitlocktech.com/api/v1/repos/whitlocktech/tickr/releases/$releaseId/assets?name=tickr.exe" \ No newline at end of file