From fb9f5a56e0605f889de3291b03fa36987f67514e Mon Sep 17 00:00:00 2001 From: Dave Friedel Date: Sun, 4 Jan 2026 01:18:06 -0500 Subject: [PATCH] Use direct API for release creation --- .gitea/workflows/release.yaml | 42 ++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index e066419..7e93021 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -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"