Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-latest, windows-2025, windows-11-arm]
os: [windows-latest, windows-2025, windows-11-arm]

runs-on: ${{ matrix.os }}

Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/test-winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,12 @@ jobs:
with:
version: 'nightly'

- name: Install komac
run: |
winget install komac --accept-source-agreements --accept-package-agreements --disable-interactivity

- name: Test Winget Install with Default Scope
shell: nu {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ls C:\Users\runneradmin\AppData\Local\Programs\Komac\bin\ | print
winget install komac --accept-source-agreements --accept-package-agreements --disable-interactivity
nu tests/winget-install.nu

user-scope:
Expand All @@ -90,14 +86,10 @@ jobs:
with:
version: 'nightly'

- name: Install komac
run: |
winget install komac --accept-source-agreements --accept-package-agreements --disable-interactivity

- name: Test Winget Install with User Scope
shell: nu {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ls C:\Users\runneradmin\AppData\Local\Programs\Komac\bin\ | print
winget install komac --accept-source-agreements --accept-package-agreements --disable-interactivity
nu tests/winget-install.nu --scope user
23 changes: 14 additions & 9 deletions tests/winget-install.nu
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@

use std/assert
use std/util ['path add']
use common.nu [check-user-install, check-version-match, get-latest-tag]

const KOMAC = 'C:\Users\runneradmin\AppData\Local\Programs\Komac\bin\komac.exe'
const KOMAC_PATH = $'($nu.home-path)\AppData\Local\Programs\Komac\bin\'

def main [--scope: string] {
prepare-manifest
let install_dir = $'($nu.home-path)\AppData\Local\Programs\nu'
let scope_tip = if $scope in [user, machine] { $'($scope) scope' } else { $'default scope' }
print $'Using winget to test MSI (ansi g)($scope_tip)(ansi reset) installation'
let args = [
const WINGET_ARGS = [
--silent
--ignore-security-hash
--disable-interactivity
--accept-source-agreements
--accept-package-agreements
]

def main [--scope: string] {
prepare-manifest
let install_dir = $'($nu.home-path)\AppData\Local\Programs\nu'
let scope_tip = if $scope in [user, machine] { $'($scope) scope' } else { $'default scope' }
print $'Using winget to test MSI (ansi g)($scope_tip)(ansi reset) installation'
let version = get-latest-tag | split row + | first
let scope_arg = if $scope in [user, machine] { [--scope $scope] } else { [] }
winget settings --enable LocalManifestFiles
winget settings --enable InstallerHashOverride
winget install --manifest $'manifests\n\Nushell\Nushell\($version)\' ...$args ...$scope_arg
winget install --manifest $'manifests\n\Nushell\Nushell\($version)\' ...$WINGET_ARGS ...$scope_arg
check-user-install $install_dir
check-version-match $version $install_dir
}

def prepare-manifest [] {
let version = get-latest-tag | split row + | first
let urls = get-download-url
^$KOMAC update Nushell.Nushell --dry-run -v $version -u ...$urls -o (pwd)
path add $KOMAC_PATH
ls $KOMAC_PATH | print
komac --version | print
komac update Nushell.Nushell --dry-run -v $version -u ...$urls -o (pwd)
}

def get-download-url [] {
Expand Down