Add update system
All checks were successful
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Successful in 37s
All checks were successful
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Successful in 37s
This commit is contained in:
@@ -63,7 +63,27 @@ jobs:
|
||||
SERVER_URL: ${{ github.server_url }}
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$uploadUrl = "$env:SERVER_URL/api/v1/repos/$env:REPO/releases/$env:RELEASE_ID/assets?name=ProgressionLoader.exe"
|
||||
# Gitea API endpoint for uploading release assets
|
||||
$uploadUrl = "$env:SERVER_URL/api/v1/repos/$env:REPO/releases/$env:RELEASE_ID/assets"
|
||||
Write-Host "Uploading ProgressionLoader.exe to $uploadUrl"
|
||||
Invoke-RestMethod -Method Post -Uri $uploadUrl -Headers @{ Authorization = "token $env:TOKEN" } -ContentType "application/octet-stream" -InFile "ProgressionLoader.exe"
|
||||
|
||||
# Use multipart form data for Gitea
|
||||
$boundary = [System.Guid]::NewGuid().ToString()
|
||||
$LF = "`r`n"
|
||||
|
||||
$fileBytes = [System.IO.File]::ReadAllBytes("ProgressionLoader.exe")
|
||||
$fileEnc = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString($fileBytes)
|
||||
|
||||
$bodyLines = (
|
||||
"--$boundary",
|
||||
"Content-Disposition: form-data; name=`"attachment`"; filename=`"ProgressionLoader.exe`"",
|
||||
"Content-Type: application/octet-stream$LF",
|
||||
$fileEnc,
|
||||
"--$boundary--$LF"
|
||||
) -join $LF
|
||||
|
||||
Invoke-RestMethod -Method Post -Uri $uploadUrl -Headers @{
|
||||
Authorization = "token $env:TOKEN"
|
||||
"Content-Type" = "multipart/form-data; boundary=$boundary"
|
||||
} -Body $bodyLines
|
||||
|
||||
|
||||
Reference in New Issue
Block a user