.forgejo/workflows/dotnet.yaml aktualisiert
Some checks failed
Dotnet Build / build (push) Failing after 1m55s
Some checks failed
Dotnet Build / build (push) Failing after 1m55s
This commit is contained in:
parent
3e2ed4b627
commit
d9981c025d
1 changed files with 19 additions and 4 deletions
|
@ -80,16 +80,31 @@ jobs:
|
||||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
PROJECT_VERSION: ${{ env.PROJECT_VERSION }}
|
PROJECT_VERSION: ${{ env.PROJECT_VERSION }}
|
||||||
run: |
|
run: |
|
||||||
|
$owner = "WeeXnes"
|
||||||
|
$repo = "WeeXnesSuite"
|
||||||
$tag = "$env:PROJECT_VERSION"
|
$tag = "$env:PROJECT_VERSION"
|
||||||
$fileName = "currentRelease_$tag.zip"
|
$fileName = "currentRelease_$tag.zip"
|
||||||
$filePath = "release/$fileName"
|
$filePath = "release/$fileName"
|
||||||
$apiUrl = "https://git.weexnes.dev/api/v1/repos/WeeXnes/WeexnesSuite/releases/tags/$tag"
|
|
||||||
|
|
||||||
$release = Invoke-RestMethod -Uri $apiUrl -Headers @{ Authorization = "token $env:RELEASE_TOKEN" }
|
# Get release info by tag to get release ID
|
||||||
$uploadUrl = $release.upload_url -replace "\{\?name,label\}", "?name=$fileName"
|
$releaseInfoUrl = "https://git.weexnes.dev/api/v1/repos/$owner/$repo/releases/tags/$tag"
|
||||||
|
try {
|
||||||
|
$release = Invoke-RestMethod -Uri $releaseInfoUrl -Headers @{ Authorization = "token $env:RELEASE_TOKEN" }
|
||||||
|
$releaseId = $release.id
|
||||||
|
Write-Host "Found release ID: $releaseId"
|
||||||
|
} catch {
|
||||||
|
Write-Error "Failed to find release with tag '$tag'. Make sure the release exists."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Upload the asset to the release by ID
|
||||||
|
$uploadUrl = "https://git.weexnes.dev/api/v1/repos/$owner/$repo/releases/$releaseId/assets?name=$fileName"
|
||||||
|
Write-Host "Uploading asset to: $uploadUrl"
|
||||||
|
|
||||||
Invoke-RestMethod -Uri $uploadUrl `
|
Invoke-RestMethod -Uri $uploadUrl `
|
||||||
-Headers @{ Authorization = "token $env:RELEASE_TOKEN" } `
|
-Headers @{ Authorization = "token $env:RELEASE_TOKEN" } `
|
||||||
-Method Post `
|
-Method Post `
|
||||||
-ContentType "application/zip" `
|
-ContentType "application/zip" `
|
||||||
-InFile $filePath
|
-InFile $filePath
|
||||||
|
|
||||||
|
Write-Host "Upload complete."
|
Loading…
Add table
Reference in a new issue