From b929c6db8ab73d4d751a5d8d00e7959d1cef99c6 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Mon, 16 Sep 2024 22:25:58 +0200 Subject: [PATCH] chocolatey: add package --- .github/workflows/package.yaml | 6 ++++++ resources/chocolatey/glazewm.nuspec | 21 +++++++++++++++++++ .../chocolatey/tools/chocolateyInstall.ps1 | 15 +++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 resources/chocolatey/glazewm.nuspec create mode 100644 resources/chocolatey/tools/chocolateyInstall.ps1 diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 8fadadc7..b15e9a2f 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -41,6 +41,12 @@ jobs: run: | ./resources/scripts/package.ps1 -VersionNumber ${{ needs.next-version.outputs.new-release-version || '3.1.0' }} + - name: Package chocolatey + run: | + choco apikey --key $CHOCO_API_KEY --source https://push.chocolatey.org/ + choco pack resources/chocolatey/glazewm.nuspec --version ${{ needs.next-version.outputs.new-release-version || '3.1.0' }} --outputdirectory out/ + choco push out/glazewm.*.nupkg + - uses: actions/upload-artifact@v4 with: name: installers diff --git a/resources/chocolatey/glazewm.nuspec b/resources/chocolatey/glazewm.nuspec new file mode 100644 index 00000000..9ab1b2e8 --- /dev/null +++ b/resources/chocolatey/glazewm.nuspec @@ -0,0 +1,21 @@ + + + + glazewm + 3.1.0 + GlazeWM is a tiling window manager for Windows inspired by i3wm. + glzr-io + https://github.com/glzr-io/glazewm + LICENSE.md + README.md + icon.ico + glazewm window-manager + + + + + + + + + diff --git a/resources/chocolatey/tools/chocolateyInstall.ps1 b/resources/chocolatey/tools/chocolateyInstall.ps1 new file mode 100644 index 00000000..7d38567c --- /dev/null +++ b/resources/chocolatey/tools/chocolateyInstall.ps1 @@ -0,0 +1,15 @@ +$ErrorActionPreference = 'Stop'; # stop on all errors + +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$installerLocation = Join-Path $toolsDir 'installer-universal.exe' + +$packageArgs = @{ + packageName = $packageName + fileType = 'exe' + file = $installerLocation + silentArgs = "/qn /norestart" + validExitCodes = @(0, 3010, 1641) + softwareName = 'GlazeWM' +} + +Install-ChocolateyInstallPackage @packageArgs