Use direct API for release creation

This commit is contained in:
2026-01-04 01:18:06 -05:00
parent 488034760c
commit fb9f5a56e0

View File

@@ -31,21 +31,31 @@ jobs:
shell: powershell
- name: Create Release
uses: https://gitea.com/actions/release-action@main
with:
token: ${{ secrets.RELEASE_TOKEN }}
tag_name: ${{ gitea.ref_name }}
title: Monitor Control ${{ gitea.ref_name }}
body: |
## Monitor Control ${{ gitea.ref_name }}
shell: powershell
env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
$tag = "${{ gitea.ref_name }}"
$repo = "misc/ControlMyMonitorManagement"
$baseUrl = "https://git.marketally.com/api/v1"
### Installation
1. Download the ZIP file
2. Extract to a folder of your choice
3. Run `DellMonitorControl.exe`
Write-Host "Creating release for tag: $tag"
Write-Host "Token length: $($env:GITEA_TOKEN.Length)"
### Requirements
- Windows 10/11
- .NET 9.0 Runtime
files: |
./MonitorControl-${{ gitea.ref_name }}.zip
$headers = @{
"Authorization" = "token $env:GITEA_TOKEN"
"Content-Type" = "application/json"
}
$body = @{
tag_name = $tag
name = "Monitor Control $tag"
body = "## Monitor Control $tag`n`n### Installation`n1. Download the ZIP file`n2. Extract to a folder`n3. Run DellMonitorControl.exe`n`n### Requirements`n- Windows 10/11`n- .NET 9.0 Runtime"
} | ConvertTo-Json
$release = Invoke-RestMethod -Uri "$baseUrl/repos/$repo/releases" -Method Post -Headers $headers -Body $body
Write-Host "Release created with ID: $($release.id)"
$filePath = "./MonitorControl-$tag.zip"
Invoke-RestMethod -Uri "$baseUrl/repos/$repo/releases/$($release.id)/assets?name=MonitorControl-$tag.zip" -Method Post -Headers @{"Authorization"="token $env:GITEA_TOKEN"} -InFile $filePath -ContentType "application/zip"
Write-Host "Asset uploaded successfully"