Use direct API for release creation
This commit is contained in:
@@ -31,21 +31,31 @@ jobs:
|
|||||||
shell: powershell
|
shell: powershell
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: https://gitea.com/actions/release-action@main
|
shell: powershell
|
||||||
with:
|
env:
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
tag_name: ${{ gitea.ref_name }}
|
run: |
|
||||||
title: Monitor Control ${{ gitea.ref_name }}
|
$tag = "${{ gitea.ref_name }}"
|
||||||
body: |
|
$repo = "misc/ControlMyMonitorManagement"
|
||||||
## Monitor Control ${{ gitea.ref_name }}
|
$baseUrl = "https://git.marketally.com/api/v1"
|
||||||
|
|
||||||
### Installation
|
Write-Host "Creating release for tag: $tag"
|
||||||
1. Download the ZIP file
|
Write-Host "Token length: $($env:GITEA_TOKEN.Length)"
|
||||||
2. Extract to a folder of your choice
|
|
||||||
3. Run `DellMonitorControl.exe`
|
|
||||||
|
|
||||||
### Requirements
|
$headers = @{
|
||||||
- Windows 10/11
|
"Authorization" = "token $env:GITEA_TOKEN"
|
||||||
- .NET 9.0 Runtime
|
"Content-Type" = "application/json"
|
||||||
files: |
|
}
|
||||||
./MonitorControl-${{ gitea.ref_name }}.zip
|
|
||||||
|
$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"
|
||||||
|
|||||||
Reference in New Issue
Block a user