From 3be37fce7b4238d72d733bfefd596c3b6f4a16cd Mon Sep 17 00:00:00 2001 From: Mu <40123877+iMusynx@users.noreply.github.com> Date: Thu, 18 Sep 2025 08:04:42 +0000 Subject: [PATCH 1/3] Task: add GameTec-live.ChameleonUltraGUI --- .../Config.yaml | 3 ++ .../GameTec-live.ChameleonUltraGUI/Script.ps1 | 50 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml create mode 100644 Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 diff --git a/Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml b/Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml new file mode 100644 index 0000000000..1c9d594ee7 --- /dev/null +++ b/Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml @@ -0,0 +1,3 @@ +Type: PackageTask +WinGetIdentifier: GameTec-live.ChameleonUltraGUI +Skip: false \ No newline at end of file diff --git a/Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 b/Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 new file mode 100644 index 0000000000..6fe19518d2 --- /dev/null +++ b/Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 @@ -0,0 +1,50 @@ +$RepoOwner = 'GameTec-live' +$RepoName = 'ChameleonUltraGUI' + +$Object1 = Invoke-GitHubApi -Uri "https://api.github.com/repos/${RepoOwner}/${RepoName}/releases/latest" + +# Version +$this.CurrentState.Version = $Object1.tag_name -creplace '^v' + +# Installer +$this.CurrentState.Installer += [ordered]@{ + InstallerUrl = $Object1.assets.Where({ $_.name.EndsWith('windows-installer.zip') }, 'First')[0].browser_download_url | ConvertTo-UnescapedUri +} + +switch -Regex ($this.Check()) { + 'New|Changed|Updated' { + try { + # ReleaseTime + $this.CurrentState.ReleaseTime = $Object1.published_at.ToUniversalTime() + + if (-not [string]::IsNullOrWhiteSpace($Object1.body)) { + # ReleaseNotes (en-US) + $this.CurrentState.Locale += [ordered]@{ + Locale = 'en-US' + Key = 'ReleaseNotes' + Value = $Object1.body | Convert-MarkdownToHtml -Extensions 'advanced', 'emojis', 'hardlinebreak' | Get-TextContent | Format-Text + } + } else { + $this.Log("No ReleaseNotes (en-US) for version $($this.CurrentState.Version)", 'Warning') + } + + # ReleaseNotesUrl + $this.CurrentState.Locale += [ordered]@{ + Key = 'ReleaseNotesUrl' + Value = $Object1.html_url + } + } catch { + $_ | Out-Host + $this.Log($_, 'Warning') + } + + $this.Print() + $this.Write() + } + 'Changed|Updated' { + $this.Message() + } + 'Updated' { + $this.Submit() + } +} \ No newline at end of file From b4e36f9942223443540b106edf74ad4b4562bada Mon Sep 17 00:00:00 2001 From: Charlie Chen <56779163+SpecterShell@users.noreply.github.com> Date: Fri, 19 Sep 2025 15:02:31 +0800 Subject: [PATCH 2/3] Refine installer URL selection, add ReleaseNotesUrl locale --- Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 b/Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 index 6fe19518d2..0ea0b5c5b5 100644 --- a/Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 +++ b/Tasks/GameTec-live.ChameleonUltraGUI/Script.ps1 @@ -8,7 +8,7 @@ $this.CurrentState.Version = $Object1.tag_name -creplace '^v' # Installer $this.CurrentState.Installer += [ordered]@{ - InstallerUrl = $Object1.assets.Where({ $_.name.EndsWith('windows-installer.zip') }, 'First')[0].browser_download_url | ConvertTo-UnescapedUri + InstallerUrl = $Object1.assets.Where({ $_.name.EndsWith('.zip') -and $_.name.Contains('windows') -and $_.name.Contains('installer') }, 'First')[0].browser_download_url | ConvertTo-UnescapedUri } switch -Regex ($this.Check()) { @@ -28,10 +28,11 @@ switch -Regex ($this.Check()) { $this.Log("No ReleaseNotes (en-US) for version $($this.CurrentState.Version)", 'Warning') } - # ReleaseNotesUrl + # ReleaseNotesUrl (en-US) $this.CurrentState.Locale += [ordered]@{ - Key = 'ReleaseNotesUrl' - Value = $Object1.html_url + Locale = 'en-US' + Key = 'ReleaseNotesUrl' + Value = $Object1.html_url } } catch { $_ | Out-Host @@ -47,4 +48,4 @@ switch -Regex ($this.Check()) { 'Updated' { $this.Submit() } -} \ No newline at end of file +} From 8dcde26af1c6b947d965c378752ab988411de2de Mon Sep 17 00:00:00 2001 From: Charlie Chen <56779163+SpecterShell@users.noreply.github.com> Date: Fri, 19 Sep 2025 15:02:54 +0800 Subject: [PATCH 3/3] Update Config.yaml --- Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml b/Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml index 1c9d594ee7..7a5cc7568e 100644 --- a/Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml +++ b/Tasks/GameTec-live.ChameleonUltraGUI/Config.yaml @@ -1,3 +1,3 @@ Type: PackageTask WinGetIdentifier: GameTec-live.ChameleonUltraGUI -Skip: false \ No newline at end of file +Skip: false