fixing workflow
This commit is contained in:
@@ -45,12 +45,53 @@ 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"
|
||||||
|
|
||||||
|
$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 `
|
Invoke-RestMethod `
|
||||||
-Uri "https://gitea.whitlocktech.com/api/v1/repos/whitlocktech/tickr/releases/$releaseId/assets?name=tickr.exe" `
|
-Uri $uri `
|
||||||
-Method Post `
|
-Method Post `
|
||||||
-Headers @{
|
-Headers @{ Authorization = "token ${{ secrets.RELEASE_TOKEN }}" } `
|
||||||
Authorization = "token ${{ secrets.RELEASE_TOKEN }}"
|
-ContentType "multipart/form-data; boundary=$boundary" `
|
||||||
} `
|
-Body $bodyBytes- name: Upload binary asset
|
||||||
-InFile $filePath `
|
shell: powershell
|
||||||
-ContentType "application/octet-stream"
|
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
|
||||||
Reference in New Issue
Block a user