Skip to content

Commit

Permalink
add workflow and update winget manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
jxy-s committed Oct 16, 2024
1 parent fd1f7ce commit 5d8f4d7
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/publish-winget-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish canary to winget

on:
workflow_dispatch:
release:
types: [published]

jobs:
winget:
name: Publish winget package
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Publish winget manifest
run: .\winget\Publish.ps1 -Channel Canary -Version Latest -Output .\winget\ -Submit {{ secrets.WINGET_TOKEN }}
- name: Update winget manifest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "Johnny Shaw"
git config user.email johnny.shaw@live.com
git add .
git commit -m "update winget manifest"
git push
91 changes: 91 additions & 0 deletions winget/Publish.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
param (
[ValidateSet("Canary", "Release")]
[string]$Channel,
[string]$Version,
[string]$Submit,
[string]$Output
)

# Fetch the latest release data from GitHub API
$releasesUrl = "https://api.github.com/repos/winsiderss/si-builds/releases"
$releases = Invoke-RestMethod -Uri $releasesUrl

# Find the appropriate release based on Channel and Version
$release = if ($Version -eq "Latest")
{
$releases[0]
}
else
{
$releases | Where-Object { $_.tag_name -eq $Version } | Select-Object -First 1
}
if (-not $release)
{
Write-Host "No matching release found for Channel: $Channel and Version: $Version"
exit 1
}

# Find the setup binary URL
$setupAsset = $release.assets | Where-Object { $_.name -match "$Channel-setup.exe" } | Select-Object -First 1
if (-not $setupAsset)
{
Write-Host "No setup binary found for Channel: $Channel in release: $($release.tag_name)"
exit 1
}

Write-Host "Setup URL: $($setupAsset.browser_download_url)"

# Download the setup binary
$setupBinary = Join-Path -Path $env:TEMP -ChildPath $setupAsset.name
Invoke-WebRequest -Uri $setupAsset.browser_download_url -OutFile $setupBinary

$setupVersion = (Get-Item $setupBinary).VersionInfo.FileVersion

# Download the latest wingetcreate
$wingetCreate = Join-Path -Path $env:TEMP -ChildPath "wingetcreate.exe"
Invoke-WebRequest -Uri "https://aka.ms/wingetcreate/latest" -OutFile $wingetCreate

$identifier = if ($Channel -eq "Canary")
{
"WinsiderSS.SystemInformer.Canary"
}
else
{
"WinsiderSS.SystemInformer"
}

# Publish to winget...

Write-Host "Publishing: $identifier $setupVersion"

$wingetCreateArgs = @(
"update",
"--urls", "$($setupAsset.browser_download_url)|neutral",
"--version", $setupVersion
)

if ($Output)
{
$wingetCreateArgs += @("--out", $Output)
}

if ($Submit)
{
$wingetCreateArgs += @(
"--submit",
"--token", $Submit
)
}

$wingetCreateArgs += @($identifier)

$process = Start-Process -FilePath $wingetCreate -ArgumentList $wingetCreateArgs -PassThru -Wait -NoNewWindow

if ($process.ExitCode -ne 0)
{
Write-Host "wingetcreate failed with exit code: $($process.ExitCode)"
exit 1
}

Write-Host "Published $identifier $setupVersion"
exit 0
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer
PackageVersion: 3.1.24283.0
Installers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer
PackageVersion: 3.1.24283.0
PackageLocale: en-US
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer
PackageVersion: 3.1.24283.0
DefaultLocale: en-US
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer.Canary
PackageVersion: 3.1.24283.0
Installers:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer.Canary
PackageVersion: 3.1.24283.0
PackageLocale: en-US
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer.Canary
PackageVersion: 3.1.24283.0
DefaultLocale: en-US
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer.Canary
PackageVersion: 3.1.24290.0
InstallerType: exe
Scope: machine
InstallModes:
- silent
- silentWithProgress
- interactive
InstallerSwitches:
Silent: -install -silent
SilentWithProgress: -install -silent
Interactive: -install
Upgrade: -update -silent
ProductCode: SystemInformer-Canary
ElevationRequirement: elevatesSelf
Installers:
- Architecture: neutral
InstallerUrl: https://github.com/winsiderss/si-builds/releases/download/3.1.24290/systeminformer-3.1.24290-canary-setup.exe
InstallerSha256: 98B2558EFCC5F1728E8BD0573DD5FFD94C7ACFBC70F75609D1064109468C3321
ManifestType: installer
ManifestVersion: 1.6.0
ReleaseDate: 2024-10-16
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer.Canary
PackageVersion: 3.1.24290.0
PackageLocale: en-US
Publisher: Winsider Seminars & Solutions, Inc.
PublisherUrl: https://windows-internals.com/
PublisherSupportUrl: https://github.com/winsiderss/systeminformer/issues
PackageName: System Informer (Canary)
PackageUrl: https://system-informer.com/
License: MIT License
LicenseUrl: https://github.com/winsiderss/systeminformer/blob/master/LICENSE.txt
Copyright: Copyright (c) Winsider Seminars & Solutions, Inc. All rights reserved.
CopyrightUrl: https://github.com/winsiderss/systeminformer/blob/master/COPYRIGHT.txt
ShortDescription: System Informer is a free, powerful, multi-purpose tool that helps you monitor system resources, debug software and detect malware.
Moniker: systeminformer-canary
Tags:
- windows
- debugger
- security
- benchmarking
- process-manager
- performance
- monitor
- monitoring
- realtime
- administrator
- process-monitor
- performance-tuning
- profiling
- monitor-performance
- performance-monitoring
- system-monitor
ReleaseNotesUrl: https://github.com/winsiderss/si-builds/releases/tag/3.1.24290
ManifestType: defaultLocale
ManifestVersion: 1.6.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Created using wingetcreate 1.6.5.0
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json

PackageIdentifier: WinsiderSS.SystemInformer.Canary
PackageVersion: 3.1.24290.0
DefaultLocale: en-US
ManifestType: version
ManifestVersion: 1.6.0

0 comments on commit 5d8f4d7

Please sign in to comment.