From 20687eb8b50c0c423d8af5b868be042ee1abebae Mon Sep 17 00:00:00 2001 From: hustcer Date: Sat, 5 Jul 2025 22:19:39 +0800 Subject: [PATCH 1/2] feat: Add build Windows MSI packages support --- .github/workflows/release-msi.nu | 62 +++++++ .github/workflows/release-msi.yml | 103 +++++++++++ wix/License.rtf | Bin 0 -> 1289 bytes wix/MSI.md | 90 ++++++++++ wix/README.txt | 0 wix/main.wixproj | 36 ++++ wix/main.wxs | 286 ++++++++++++++++++++++++++++++ wix/nu.ico | Bin 0 -> 7488 bytes wix/prepare-winget.nu | 57 ++++++ wix/windows-terminal-profile.json | 11 ++ 10 files changed, 645 insertions(+) create mode 100755 .github/workflows/release-msi.nu create mode 100644 .github/workflows/release-msi.yml create mode 100644 wix/License.rtf create mode 100644 wix/MSI.md create mode 100644 wix/README.txt create mode 100644 wix/main.wixproj create mode 100644 wix/main.wxs create mode 100644 wix/nu.ico create mode 100644 wix/prepare-winget.nu create mode 100644 wix/windows-terminal-profile.json diff --git a/.github/workflows/release-msi.nu b/.github/workflows/release-msi.nu new file mode 100755 index 0000000000..6bb4b525a3 --- /dev/null +++ b/.github/workflows/release-msi.nu @@ -0,0 +1,62 @@ +#!/usr/bin/env nu + +# Created: 2025/05/21 19:05:20 +# Description: +# A script to build Windows MSI packages for NuShell. Need wix 6.0 to be installed. +# The script will download the specified NuShell release, extract it, and create an MSI package. +# Can be run locally or in GitHub Actions. +# To run this script locally: +# load-env { TARGET: 'x86_64-pc-windows-msvc' REF: '0.103.0' GITHUB_REPOSITORY: 'nushell/nushell' } +# nu .github/workflows/release-msi.nu + +def build-msi [] { + let target = $env.TARGET + # We should read the version from the environment variable first + # As we may build the MSI package for a specific version not the latest one + let version = $env.MSI_VERSION + let arch = if $nu.os-info.arch =~ 'x86_64' { 'x64' } else { 'arm64' } + + print $'Building msi package for (ansi g)($target)(ansi reset) with version (ansi g)($version)(ansi reset) from tag (ansi g)($env.REF)(ansi reset)...' + fetch-nu-pkg + # Create extra Windows msi release package if dotnet and wix are available + let installed = [dotnet wix] | all { (which $in | length) > 0 } + if $installed and (wix --version | split row . | first | into int) >= 6 { + + print $'(char nl)Start creating Windows msi package with the following contents...' + cd wix; hr-line + cp nu/README.txt . + ls -f nu/* | print + ./nu/nu.exe -c $'NU_RELEASE_VERSION=($version) dotnet build -c Release -p:Platform=($arch)' + glob **/*.msi | print + # Workaround for https://github.com/softprops/action-gh-release/issues/280 + let wixRelease = (glob **/*.msi | where $it =~ bin | get 0 | str replace --all '\' '/') + let msi = $'($wixRelease | path dirname)/nu-($version)-($target).msi' + mv $wixRelease $msi + print $'MSI archive: ---> ($msi)'; + # Run only in GitHub Actions + if ($env.GITHUB_ACTIONS? | default false | into bool) { + echo $"msi=($msi)(char nl)" o>> $env.GITHUB_OUTPUT + } + } +} + +def fetch-nu-pkg [] { + mkdir wix/nu + # See: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables + gh release download $env.REF --repo nushell/nushell --pattern $'*-($env.TARGET).zip' --dir wix/nu + cd wix/nu + let pkg = ls *.zip | get name.0 + unzip $pkg + rm $pkg + ls | print +} + +# Print a horizontal line marker +def 'hr-line' [ + --blank-line(-b) +] { + print $'(ansi g)---------------------------------------------------------------------------->(ansi reset)' + if $blank_line { char nl } +} + +alias main = build-msi diff --git a/.github/workflows/release-msi.yml b/.github/workflows/release-msi.yml new file mode 100644 index 0000000000..67e2926dd3 --- /dev/null +++ b/.github/workflows/release-msi.yml @@ -0,0 +1,103 @@ +# +# REF: +# 1. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude +# +name: Build Windows MSI + +on: + workflow_dispatch: + inputs: + tag: + required: true + description: 'Tag of nushell/nushell' + release: + description: 'Release Tag of Integrations' + +permissions: + contents: write + packages: write + +defaults: + run: + shell: bash + +jobs: + release: + name: Nu + + strategy: + fail-fast: false + matrix: + target: + - x86_64-pc-windows-msvc + - aarch64-pc-windows-msvc + extra: ['bin'] + + include: + - target: x86_64-pc-windows-msvc + os: windows-latest + - target: aarch64-pc-windows-msvc + os: windows-11-arm + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Wix Toolset 6 for Windows + shell: pwsh + if: ${{ startsWith(matrix.os, 'windows') }} + run: | + dotnet tool install --global wix --version 6.0.0 + dotnet workload install wix + $wixPath = "$env:USERPROFILE\.dotnet\tools" + echo "$wixPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $env:PATH = "$wixPath;$env:PATH" + wix --version + + - name: Setup Nushell + uses: hustcer/setup-nu@v3 + with: + version: 0.105.1 + + - name: Release MSI Packages + id: nu + run: nu .github/workflows/release-msi.nu + env: + OS: ${{ matrix.os }} + REF: ${{ inputs.tag }} + TARGET: ${{ matrix.target }} + MSI_VERSION: ${{ inputs.tag }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # REF: https://github.com/marketplace/actions/gh-release + - name: Publish Archive + uses: softprops/action-gh-release@v2.0.5 + with: + tag_name: ${{ inputs.release }} + files: ${{ steps.nu.outputs.msi }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + sha256sum: + needs: release + name: Create Sha256sum + runs-on: ubuntu-latest + steps: + - name: Download Release Archives + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: >- + gh release download ${{ inputs.release }} + --repo ${{ github.repository }} + --pattern '*' + --dir release + - name: Create Checksums + run: cd release && rm -f SHA256SUMS && shasum -a 256 * > ../SHA256SUMS + - name: Publish Checksums + uses: softprops/action-gh-release@v2.0.5 + with: + files: SHA256SUMS + tag_name: ${{ inputs.release }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/wix/License.rtf b/wix/License.rtf new file mode 100644 index 0000000000000000000000000000000000000000..9e78b15aefd7703836de3cac2c733b4ea7897dd7 GIT binary patch literal 1289 zcmZ8hUu)Ys6u-}feuqP!wqbIU(7|^1?594kn2Ln;04J5thJ zItWR0bk6VJF@C9y>lU>btqNbwalcr8Ue>Mbx_Le7Nj3U#6z-+&^yu7fz(4c48`V&E zO)rdZSfv@8u|saM}PA6>p_hBuaM~Dvr+rr!H4D}Ea%J5zk+OFjjZ&B#gx77KF9BQ3COx)y;H}qZ7{ab!w0nJ~&i) zQ(Y!*J_eFjiUHJ!XcFG8;G|ryCkIAaXH?@cB5Z1gsr4G(t_O8c7Y08bGO=FyWYK}w z8Norfs`I}x*g8(TLD@cnR(a^%RGy5AU5|MBQXYq{L8grqvi(U<^CLidWw0VbCXUt6toTk-lEO_~;rS+l2g=vQmIHRMIOmU0tRT)G;a{4k5s?2%Myd)526R(q zlwghKNw!UCeh+szmlqr|x}h9Fc@YRNP?X@@3O0l#YebIkXh!*C1S`sOkGVq77|NJ& znryR}LAhmRQ4yq15jLm!iXjWxkettu6>C7g;{mF5oMnM3-lBRI^d&|4$mso=!@9^) zg2g+6%Hq3>oT<=MlErirK^kx3d#{c`feEqDc2W1RCZU9UF@6$Gi`?5tikve%M(C39 z-=hz-A`!%lRz8pwD-hnti4#7v+|T9YjN+qyzY%Ql8``4j-&#@ + + Package + nu-$(Platform) + 82D756D2-19FA-4F09-B10F-64942E89F364 + + SourceDir=$(MSBuildProjectDirectory)\nu; + + true + ICE80 + + + + x64 + $(DefineConstants) + + + + arm64 + $(DefineConstants) + + + + + + + + + + + + + + + + diff --git a/wix/main.wxs b/wix/main.wxs new file mode 100644 index 0000000000..bb631dd581 --- /dev/null +++ b/wix/main.wxs @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wix/nu.ico b/wix/nu.ico new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al 0 HcmV?d00001 diff --git a/wix/prepare-winget.nu b/wix/prepare-winget.nu new file mode 100644 index 0000000000..579d364309 --- /dev/null +++ b/wix/prepare-winget.nu @@ -0,0 +1,57 @@ +const FROM_REF = '0.105.1' +const PREV_VER = '0.105.0' +const LAST_VER = '0.105.1' +const OSS_DEST = 'oss://terminus-new-trantor/open-tools/misc' +const OSS_ENDPOINT = 'https://terminus-new-trantor.oss-cn-hangzhou.aliyuncs.com/open-tools/misc' + +export def prepare [] { + + rm -rf obj/ bin/ + nu -c $'NU_RELEASE_VERSION=($PREV_VER) dotnet build -c Release -p:Platform=x64' + ossutil cp -f bin\x64\Release\nu-x64.msi $'($OSS_DEST)/nu-($PREV_VER)-x86_64-pc-windows-msvc.msi' + + rm -rf obj/ bin/ + nu -c $'NU_RELEASE_VERSION=($LAST_VER) dotnet build -c Release -p:Platform=x64' + ossutil cp -f bin\x64\Release\nu-x64.msi $'($OSS_DEST)/nu-($LAST_VER)-x86_64-pc-windows-msvc.msi' +} + +export def upgrade-nu-by-winget [ + --no-hash(-n), +] { + + let prevUrl = $'($OSS_ENDPOINT)/nu-($PREV_VER)-x86_64-pc-windows-msvc.msi' + let lastUrl = $'($OSS_ENDPOINT)/nu-($LAST_VER)-x86_64-pc-windows-msvc.msi' + # sudo winget settings --enable InstallerHashOverride + winget uninstall nushell | complete + if ($no_hash) { + winget install --manifest manifests\n\Nushell\Nushell\($PREV_VER) --ignore-security-hash --silent + winget upgrade --manifest manifests\n\Nushell\Nushell\($LAST_VER) --ignore-security-hash --silent + return + } + komac update Nushell.Nushell --dry-run -v $PREV_VER -u $prevUrl --output . + komac update Nushell.Nushell --dry-run -v $LAST_VER -u $lastUrl --output . + winget install --manifest manifests\n\Nushell\Nushell\($PREV_VER) --ignore-security-hash --silent + winget upgrade --manifest manifests\n\Nushell\Nushell\($LAST_VER) --ignore-security-hash --silent +} + +def rebuild [--fetch(-f)] { + if $fetch { fetch-nu-pkg } + rm -rf obj/ bin/ + nu -c $'NU_RELEASE_VERSION=($LAST_VER) dotnet build -c Release -p:Platform=x64' + ossutil cp -f bin\x64\Release\nu-x64.msi $'($OSS_DEST)/nu-($LAST_VER)-x86_64-pc-windows-msvc.msi' + winget uninstall nushell | complete + # msiexec /i bin\x64\Release\nu-x64.msi ALLUSERS=1 + winget install --manifest manifests\n\Nushell\Nushell\($LAST_VER) --ignore-security-hash --silent --scope machine +} + +def fetch-nu-pkg [] { + mkdir nu + gh release download $FROM_REF --repo nushell/nushell --pattern $'*-x86_64-*.zip' --dir nu + cd nu + let pkg = ls *.zip | get name.0 + unzip $pkg + rm $pkg + ls | print +} + +alias main = rebuild diff --git a/wix/windows-terminal-profile.json b/wix/windows-terminal-profile.json new file mode 100644 index 0000000000..59866bb527 --- /dev/null +++ b/wix/windows-terminal-profile.json @@ -0,0 +1,11 @@ +{ + "profiles": [ + { + "guid": "{47302f9c-1ac4-566c-aa3e-8cf29889d6ab}", + "name": "Nushell", + "commandline": "nu.exe", + "icon": "nu.ico", + "startingDirectory": "%USERPROFILE%" + } + ] +} From 9f6baf6543e798797b8b0ce77a125e0746284074 Mon Sep 17 00:00:00 2001 From: hustcer Date: Tue, 15 Jul 2025 19:59:41 +0800 Subject: [PATCH 2/2] fix: Fix getting Nu binary path for Nushell 0.106 --- Justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Justfile b/Justfile index f7eaffb788..fdf41d57d5 100644 --- a/Justfile +++ b/Justfile @@ -24,7 +24,7 @@ set positional-arguments := true # Used to handle the path separator issue NU_DISTRO_PATH := parent_directory(justfile()) -NU_DIR := parent_directory(`(which nu).path.0`) +NU_DIR := parent_directory(`$nu.current-exe`) _query_plugin := if os_family() == 'windows' { 'nu_plugin_query.exe' } else { 'nu_plugin_query' } # To pass arguments to a dependency, put the dependency