From 210036ddae81079a6489995459cbb7770bfb0a4b Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Fri, 9 May 2025 21:23:06 +0300 Subject: [PATCH] Update winget.yml --- .github/workflows/winget.yml | 40 +++++++++++++++---- .../TeamSophia.SophiaScript.installer.yaml | 21 ++++++++++ .../TeamSophia.SophiaScript.locale.en-US.yaml | 38 ++++++++++++++++++ .../TeamSophia.SophiaScript.yaml | 8 ++++ 4 files changed, 99 insertions(+), 8 deletions(-) create mode 100644 Scripts/WinGet_Manifests/TeamSophia.SophiaScript.installer.yaml create mode 100644 Scripts/WinGet_Manifests/TeamSophia.SophiaScript.locale.en-US.yaml create mode 100644 Scripts/WinGet_Manifests/TeamSophia.SophiaScript.yaml diff --git a/.github/workflows/winget.yml b/.github/workflows/winget.yml index 4c3bbf72..7a8c66b6 100644 --- a/.github/workflows/winget.yml +++ b/.github/workflows/winget.yml @@ -6,22 +6,46 @@ on: jobs: publish: runs-on: windows-latest + steps: - - name: Getting latest release for Windows 11 + - name: Checkout repository + uses: actions/checkout@main + + - name: Preparation run: | + # Get latest version tag for Windows 11 + $Parameters = @{ + Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/refs/heads/master/sophia_script_versions.json" + UseBasicParsing = $true + } + $Version = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1 + + # Get archive hash $Parameters = @{ - Uri = "https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/sophia_script_versions.json" + Uri = "https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$($Version)/Sophia.Script.for.Windows.11.v$($Version).zip" + UseBasicParsing = $true } - $Latest_Release = (Invoke-RestMethod @Parameters).Sophia_Script_Windows_11_PowerShell_5_1 + $Request = (Invoke-WebRequest @Parameters).RawContentStream + $Hash = (Get-FileHash -InputStream $Request).Hash - $InstallerUrl = https://github.com/farag2/Sophia-Script-for-Windows/releases/download/$Latest_Release/Sophia.Script.for.Windows.11.v$($Latest_Release).zip + # Update the metadata for the files + Get-ChildItem -Path Scripts\WinGet_Manifests | ForEach-Object -Process { + (Get-Content -Path $_.FullName -Encoding UTF8 -Raw) | Foreach-Object -Process { + $_ -replace "SophiaScriptVersion", $Version ` + -replace "SophiaScriptHash", $Hash ` + -replace "SophiaScriptDate", $(Get-Date -Format "yyyy-MM-dd") + } | Set-Content -Path $_.FullName -Encoding utf8 -Force + } - - name: Create winget PR + - name: Publish to WinGet run: | + # Get the latest wingetcreate + # https://github.com/microsoft/winget-create $Parameters = @{ - Uri = "https://aka.ms/wingetcreate/latest" - OutFile = "wingetcreate.exe" + Uri = "https://aka.ms/wingetcreate/latest" + OutFile = "wingetcreate.exe" + UseBasicParsing = $true } Invoke-WebRequest @Parameters - & wingetcreate.exe update TeamSophia.SophiaScript --urls $installerUrl --version $Latest_Release --token "${{ secrets.WINGET_TOKEN }}" --submit + .\wingetcreate.exe submit --prtitle "New Version: TeamSophia.SophiaScript version $Version" --token "${{ secrets.WINGET_PAT }}" "Scripts\WinGet_Manifests" diff --git a/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.installer.yaml b/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.installer.yaml new file mode 100644 index 00000000..47b7b93f --- /dev/null +++ b/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.installer.yaml @@ -0,0 +1,21 @@ +# Created with YamlCreate.ps1 v2.4.6 $debug=NVS1.CRLF.5-1-26100-3624.Win32NT +# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.10.0.schema.json +# https://github.com/microsoft/winget-pkgs/blob/master/Tools/YamlCreate.ps1 + +PackageIdentifier: TeamSophia.SophiaScript +PackageVersion: SophiaScriptVersion +InstallerLocale: en-US +InstallerType: zip +Commands: +- sophiascript +ReleaseDate: SophiaScriptDate +Installers: +- Architecture: x64 + NestedInstallerType: portable + NestedInstallerFiles: + - RelativeFilePath: Sophia_Script_for_Windows_11_vSophiaScriptVersion\Sophia.ps1 + PortableCommandAlias: sophiascript + InstallerUrl: https://github.com/farag2/Sophia-Script-for-Windows/releases/download/SophiaScriptVersion/Sophia.Script.for.Windows.11.vSophiaScriptVersion.zip + InstallerSha256: SophiaScriptHash +ManifestType: installer +ManifestVersion: 1.10.0 diff --git a/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.locale.en-US.yaml b/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.locale.en-US.yaml new file mode 100644 index 00000000..b9429f2b --- /dev/null +++ b/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.locale.en-US.yaml @@ -0,0 +1,38 @@ +# Created with YamlCreate.ps1 v2.4.6 $debug=NVS1.CRLF.5-1-26100-3624.Win32NT +# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.10.0.schema.json + +PackageIdentifier: TeamSophia.SophiaScript +PackageVersion: SophiaScriptVersion +PackageLocale: en-US +Publisher: Team Sophia +PublisherUrl: https://github.com/farag2/Sophia-Script-for-Windows +PublisherSupportUrl: https://t.me/sophia_chat +Author: farag2 +PackageName: Sophia Script for Windows +PackageUrl: https://github.com/farag2/Sophia-Script-for-Windows +License: MIT +LicenseUrl: https://github.com/farag2/Sophia-Script-for-Windows/blob/master/LICENSE +Copyright: Copyright (c) 2014—2025 Team Sophia +ShortDescription: The most powerful PowerShell module on GitHub for Windows 10 and Windows 11 fine-tuning and tweaking +Description: Sophia Script for Windows is the largest PowerShell module on GitHub for Windows 10 and Windows 11 fine-tuning and automating the routine tasks +Moniker: sophiascript +Tags: +- windows +- gui +- script +- powershell +- tweaks +- windows-10 +- sophia +- tweaker +- tweak +- debloat +- debloating +- windows-11 +- debloater +- windows-debloat +- sophia-script +- 24h2 +ReleaseNotesUrl: https://github.com/farag2/Sophia-Script-for-Windows/blob/master/CHANGELOG.md +ManifestType: defaultLocale +ManifestVersion: 1.10.0 diff --git a/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.yaml b/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.yaml new file mode 100644 index 00000000..d878554e --- /dev/null +++ b/Scripts/WinGet_Manifests/TeamSophia.SophiaScript.yaml @@ -0,0 +1,8 @@ +# Created with YamlCreate.ps1 v2.4.6 $debug=NVS1.CRLF.5-1-26100-3624.Win32NT +# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.10.0.schema.json + +PackageIdentifier: TeamSophia.SophiaScript +PackageVersion: SophiaScriptVersion +DefaultLocale: en-US +ManifestType: version +ManifestVersion: 1.10.0