diff --git a/.github/workflows/test-msi.yml b/.github/workflows/test-msi.yml index 78a04fa32..45f59f920 100644 --- a/.github/workflows/test-msi.yml +++ b/.github/workflows/test-msi.yml @@ -67,49 +67,3 @@ jobs: --returns summary | to json | save --force test-summary.json ) - # machine-scope: - # name: Install with Machine Scope - - # strategy: - # fail-fast: false - # matrix: - # os: [windows-latest] - - # runs-on: ${{ matrix.os }} - - # steps: - # - uses: actions/checkout@v4 - - # - name: Setup Nu - # uses: hustcer/setup-nu@v3 - # with: - # version: 'nightly' - - # - name: Download MSI - # shell: nu {0} - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # const RELEASE_TAG = 'v0.104.1' - # mkdir msi-pkgs; cd msi-pkgs - # let arch = $nu.os-info.arch - # gh release download $RELEASE_TAG --repo nushell/nightly --pattern $"*-($arch)-*.msi" - - # - name: Test MSI Install with Machine Scope - # shell: powershell - # run: | - # # Create a temporary script that will be run with elevation - # @" - # `$ErrorActionPreference = 'Stop' - # `$msi = Get-ChildItem -Path ./msi-pkgs -Filter *.msi | Select-Object -First 1 - # Start-Process msiexec.exe -ArgumentList "/i `$(`$msi.FullName) ALLUSERS=1 /qn /norestart /L*V install.txt" -Wait -NoNewWindow -Verb RunAs - # "@ | Out-File -FilePath elevate-install.ps1 - - # # Run the script with elevation - # Start-Process powershell.exe -ArgumentList "-File elevate-install.ps1" -Verb RunAs -Wait - - # - name: Try Running Nu - # shell: nu {0} - # run: | - # # ^'C:\Program Files\nu\bin\nu.exe' -c 'version' - # ^'C:\Users\runneradmin\AppData\Local\Programs\nu\bin\nu.exe' -c 'version' diff --git a/.github/workflows/test-winget.yml b/.github/workflows/test-winget.yml index b050c7565..e9d379ebf 100644 --- a/.github/workflows/test-winget.yml +++ b/.github/workflows/test-winget.yml @@ -56,11 +56,16 @@ 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 nu tests/winget-install.nu user-scope: @@ -85,47 +90,14 @@ 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 nu tests/winget-install.nu --scope user - - # machine-scope: - # name: Install with Machine Scope - - # strategy: - # fail-fast: false - # matrix: - # os: [windows-latest, windows-2025] - - # runs-on: ${{ matrix.os }} - - # steps: - # - uses: actions/checkout@v4 - - # - name: Install winget - # if: ${{ matrix.os == 'windows-latest' }} - # uses: Cyberboss/install-winget@v1 - - # - name: Setup Nu - # uses: hustcer/setup-nu@v3 - # with: - # version: 'nightly' - - # - name: Test Winget Install with Machine Scope - # shell: powershell - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # winget settings --enable LocalManifestFiles - # Start-Process -FilePath "powershell.exe" -Verb RunAs -ArgumentList @( - # "-Command", - # "'winget install --manifest manifests/n/Nushell/Nushell/0.104.1 --scope machine --accept-source-agreements --accept-package-agreements'" - # ) - - # - name: Try Running Nu - # shell: nu {0} - # run: | - # ^'C:\Program Files\nu\bin\nu.exe' -c 'version' diff --git a/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.installer.yaml b/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.installer.yaml deleted file mode 100644 index cedffead2..000000000 --- a/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.installer.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Created with WinGet Releaser using komac v2.11.2 -# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.9.0.schema.json - -PackageIdentifier: Nushell.Nushell -PackageVersion: 0.104.1 -InstallerLocale: en-US -InstallerType: wix -Scope: user -InstallModes: -- interactive -- silent -- silentWithProgress -UpgradeBehavior: install -Commands: -- nu -ReleaseDate: 2025-05-15 -InstallationMetadata: - DefaultInstallLocation: nu -Installers: -- Architecture: x64 - InstallerUrl: https://github.com/nushell/nightly/releases/download/v0.104.1/nu-0.104.1-x86_64-pc-windows-msvc.msi - InstallerSha256: EF8FDC307EF9BFDC1D6AC50E2C5EF5CF4D232B0D55CC59F27CD73B753091149A - ProductCode: '{E2BC2C5B-BA10-478F-8554-FAE782BA3CBA}' - AppsAndFeaturesEntries: - - DisplayName: Nushell - ProductCode: '{E2BC2C5B-BA10-478F-8554-FAE782BA3CBA}' - UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}' -- Architecture: arm64 - InstallerUrl: https://github.com/nushell/nightly/releases/download/v0.104.1/nu-0.104.1-aarch64-pc-windows-msvc.msi - InstallerSha256: 95A9C9BCAB8FEC7E763F3C42380150598C9DB1511746DEF81187D17EDBD4C71B - ProductCode: '{22E058B2-6A33-43F2-8D25-203711F9BF50}' - AppsAndFeaturesEntries: - - DisplayName: Nushell - ProductCode: '{22E058B2-6A33-43F2-8D25-203711F9BF50}' - UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}' -ManifestType: installer -ManifestVersion: 1.9.0 diff --git a/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.locale.en-US.yaml b/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.locale.en-US.yaml deleted file mode 100644 index 331279c75..000000000 --- a/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.locale.en-US.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# Created with WinGet Releaser using komac v2.11.2 -# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.9.0.schema.json - -PackageIdentifier: Nushell.Nushell -PackageVersion: 0.104.1 -PackageLocale: en-US -Publisher: The Nushell Project Developers -PublisherUrl: https://www.nushell.sh/ -PublisherSupportUrl: https://github.com/nushell/nushell/issues -Author: The Nu Project Contributors -PackageName: nu -PackageUrl: https://github.com/nushell/nushell -License: MIT -LicenseUrl: https://github.com/nushell/nushell/blob/HEAD/LICENSE -Copyright: Copyright (c) 2019 - 2021 Yehuda Katz, Jonathan Turner -CopyrightUrl: https://raw.githubusercontent.com/nushell/nushell/main/LICENSE -ShortDescription: A new type of shell -Description: |- - Hello, and welcome to the Nushell project. - The goal of this project is to take the Unix philosophy of shells, where pipes connect simple commands together, and bring it to the modern style of development. - Nu takes cues from a lot of familiar territory, traditional shells like bash, object based shells like PowerShell, functional programming, systems programming, and more. -Moniker: nushell -Tags: -- rust -- shell -ReleaseNotes: |- - This is the 0.104.0 release of Nushell. You can learn more about this release here: https://www.nushell.sh/blog/2025-04-29-nushell_0_104_0.html - For convenience, we are providing full builds for Windows, Linux, and macOS. Be sure you have the requirements to enable all capabilities: https://www.nushell.sh/book/installation.html#dependencies - This release was made possible by PR contributions from @0x4D5352, @132ikl, @app/dependabot, @AucaCoyan, @ayax79, @Bahex, @blindFS, @cosineblast, @cptpiepmatz, @fdncred, @fennewald, @g2p, @hfrentzel, @hustcer, @IanManske, @jjflash95, @kidrigger, @lazenga, @LoicRiegel, @migraine-user, @MMesch, @mokurin000, @Mrfiregem, @mztikk, @NotTheDr01ds, @pyz4, @scarlet-storm, @sebasnallar, @sgvictorino, @sholderbach, @SkillFlame, @suimong, @Tyarel8, @vansh284, @whiter001, @WindSoilder, @ysthakur, @zhiburt -ReleaseNotesUrl: https://github.com/nushell/nightly/releases/tag/v0.104.1 -ManifestType: defaultLocale -ManifestVersion: 1.9.0 diff --git a/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.yaml b/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.yaml deleted file mode 100644 index 411858959..000000000 --- a/manifests/n/Nushell/Nushell/0.104.1/Nushell.Nushell.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Created with WinGet Releaser using komac v2.11.2 -# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.9.0.schema.json - -PackageIdentifier: Nushell.Nushell -PackageVersion: 0.104.1 -DefaultLocale: en-US -ManifestType: version -ManifestVersion: 1.9.0 diff --git a/tests/common.nu b/tests/common.nu index c1a73a3fc..a7a84e526 100644 --- a/tests/common.nu +++ b/tests/common.nu @@ -88,3 +88,11 @@ export def check-version-match [version_expected: string, install_dir = $USER_IN assert equal ($version_expected | str contains $version) true print $'(ansi g)Installed Nu of the specified version: ($version)(ansi reset)' } + +export def get-latest-tag [] { + http get https://api.github.com/repos/nushell/nightly/releases + | sort-by -r created_at + | where tag_name =~ nightly + | get tag_name?.0? + | default '' +} diff --git a/tests/test-msi.nu b/tests/test-msi.nu index 64af20f49..ddfd4aae8 100644 --- a/tests/test-msi.nu +++ b/tests/test-msi.nu @@ -1,20 +1,20 @@ use std/assert use std/testing * -use common.nu [check-user-install, check-version-match] +use common.nu [check-user-install, check-version-match, get-latest-tag] -const RELEASE_TAG = 'v0.104.1' @before-all def setup [] { mkdir msi-pkgs cd msi-pkgs let arch = $nu.os-info.arch - gh release download $RELEASE_TAG --repo nushell/nightly --pattern $"*-($arch)-*.msi" + let release_tag = get-latest-tag + gh release download $release_tag --repo nushell/nightly --pattern $"*-($arch)-*.msi" let msi = ls | where name =~ msi | get name.0 print $'MSI File: ($msi)' let install_dir = $'($nu.home-path)\AppData\Local\Programs\nu' - { msi: $msi, install_dir: $install_dir } + { msi: $msi, install_dir: $install_dir, release_tag: $release_tag } } @test @@ -30,6 +30,7 @@ def 'msi-install:MSI should exists' [] { def 'msi-install:MSI should install successfully for per-user' [] { let pkg = $in.msi let install_dir = $in.install_dir + let release_tag = $in.release_tag cd msi-pkgs @@ -38,5 +39,6 @@ def 'msi-install:MSI should install successfully for per-user' [] { msiexec /i $pkg MSIINSTALLPERUSER=1 /quiet /qn /L*V install.txt # print (open -r install.txt) check-user-install $install_dir - check-version-match $RELEASE_TAG $install_dir + check-version-match $release_tag $install_dir } + diff --git a/tests/winget-install.nu b/tests/winget-install.nu index ec9791af8..668df6626 100644 --- a/tests/winget-install.nu +++ b/tests/winget-install.nu @@ -1,19 +1,39 @@ use std/assert -use common.nu [check-user-install, check-version-match] +use common.nu [check-user-install, check-version-match, get-latest-tag] -const VERSION = '0.104.1' +const KOMAC = 'C:\Users\runneradmin\AppData\Local\Programs\Komac\bin\komac.exe' 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 = [--accept-source-agreements --accept-package-agreements --ignore-security-hash --silent] + let args = [ + --silent + --ignore-security-hash + --disable-interactivity + --accept-source-agreements + --accept-package-agreements + ] + 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)\' ...$args ...$scope_arg check-user-install $install_dir - check-version-match $VERSION $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) +} + +def get-download-url [] { + http get https://api.github.com/repos/nushell/nightly/releases + | sort-by -r created_at + | where tag_name =~ nightly | get assets.0.browser_download_url + | where $it =~ 'msi' }