mirror of
https://github.com/nushell/nushell.git
synced 2025-06-19 17:38:14 +02:00
Allow specifying MSI version via env var and workflow input (#15828)
# Description This PR enhances the MSI release workflow by allowing the MSI package version to be specified either through an environment variable or a workflow input. This improvement provides greater flexibility when building MSI packages for tags that do **not** match the latest package version in `Cargo.toml`. Fix possible **403** error while updating `SHA256SUMS` file in the nushell/nightly repo # User-Facing Changes None # Tests + Formatting A example running record: https://github.com/nushell/nightly/actions/runs/15265879087/job/42931344366#step:5:11
This commit is contained in:
parent
cbd7608898
commit
ff4907ed3b
6
.github/workflows/release-msi.nu
vendored
6
.github/workflows/release-msi.nu
vendored
@ -11,10 +11,12 @@
|
||||
|
||||
def build-msi [] {
|
||||
let target = $env.TARGET
|
||||
let version = (open Cargo.toml | get package.version)
|
||||
# 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? | default (open Cargo.toml | get package.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)($env.REF)(ansi reset)'
|
||||
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 }
|
||||
|
7
.github/workflows/release-msi.yml
vendored
7
.github/workflows/release-msi.yml
vendored
@ -10,6 +10,12 @@ on:
|
||||
tag:
|
||||
required: true
|
||||
description: 'Tag to Rebuild MSI'
|
||||
version:
|
||||
description: 'Version of Rebuild MSI'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@ -61,6 +67,7 @@ jobs:
|
||||
OS: ${{ matrix.os }}
|
||||
REF: ${{ inputs.tag }}
|
||||
TARGET: ${{ matrix.target }}
|
||||
MSI_VERSION: ${{ inputs.version }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# REF: https://github.com/marketplace/actions/gh-release
|
||||
|
Loading…
x
Reference in New Issue
Block a user