Skip to content

Commit 0ce0ad3

Browse files
committed
release v3.5.0 generated by @lando/prepare-release-action
1 parent b80d322 commit 0ce0ad3

File tree

6 files changed

+69
-36
lines changed

6 files changed

+69
-36
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
22

3+
## v3.5.0 - [November 22, 2024](https://github.com/lando/setup-lando/releases/tag/v3.5.0)
4+
35
* Added `path` based installation to POSIX `setup-lando.sh` script
46
* Added GitHub Actions `RUNNER_DEBUG` support to PowerShell script
57
* Fixed bug preventing POSIX/Windows script from replacing existing `lando` installations

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46569,7 +46569,7 @@ var __webpack_exports__ = {};
4656946569
"use strict";
4657046570

4657146571

46572-
const SCRIPT_VERSION = 'v3.4.5';
46572+
const SCRIPT_VERSION = 'v3.5.0';
4657346573

4657446574
const core = __nccwpck_require__(7484);
4657546575
const exec = __nccwpck_require__(5236);

dist/setup-lando.ps1

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if ($env:LANDO_VERSION -ne $null -and $env:LANDO_VERSION -ne "" -and $Version -e
5151
$Version = $env:LANDO_VERSION
5252
}
5353

54-
$SCRIPT_VERSION = "v3.4.5"
54+
$SCRIPT_VERSION = "v3.5.0"
5555
$LANDO_DEFAULT_MV = "3"
5656
$LANDO_SETUP_PS1_URL = "https://get.lando.dev/setup-lando.ps1"
5757
$LANDO_SETUP_SH_URL = "https://get.lando.dev/setup-lando.sh"
@@ -66,6 +66,9 @@ Set-StrictMode -Version 1
6666
# We'll still need to check exit codes on any exe we run.
6767
$ErrorActionPreference = "Stop"
6868

69+
# Allow github actions to set $Debug
70+
if ($env:RUNNER_DEBUG -ne $null -and $env:RUNNER_DEBUG -ne "") {$Debug = $true}
71+
6972
# Normalize debug preference
7073
$DebugPreference = If ($Debug) { "Continue" } Else { $DebugPreference }
7174
if ($DebugPreference -eq "Inquire" -or $DebugPreference -eq "Continue") {
@@ -74,9 +77,6 @@ if ($DebugPreference -eq "Inquire" -or $DebugPreference -eq "Continue") {
7477
$Host.PrivateData.DebugForegroundColor = "Gray"
7578
$Host.PrivateData.DebugBackgroundColor = $Host.UI.RawUI.BackgroundColor
7679

77-
# Encoding must be Unicode to support parsing wsl.exe output
78-
[Console]::OutputEncoding = [System.Text.Encoding]::Unicode
79-
8080
Write-Host "Lando Windows Installer" -ForegroundColor Cyan
8181

8282
# Validates whether the system environment is supported
@@ -101,6 +101,7 @@ function Confirm-Environment {
101101
# Check for WSL
102102
$wslVersion = $null
103103
if (Test-Path "$env:WINDIR\system32\wsl.exe") {
104+
$env:WSL_UTF8 = "1"
104105
$wslVersion = & wsl.exe --version | Out-String
105106
# Check for "WSL version" string on the first line
106107
if ($wslVersion -notmatch "WSL version") {
@@ -111,6 +112,7 @@ function Confirm-Environment {
111112
$wslList = & wsl.exe --list --verbose | Out-String
112113
Write-Debug "WSL Instances:`n$wslList"
113114
}
115+
Remove-Item Env:WSL_UTF8
114116
}
115117
if (-not $wslVersion) {
116118
Write-Debug "WSL is not installed."
@@ -226,12 +228,12 @@ function Resolve-VersionAlias {
226228
$variant = if ($Version -match "^3-" -and !$Fat) { "-slim" } else { "" }
227229
$downloadUrl = "${baseUrl3}${VersionLabel}/lando-win-${arch}-${VersionLabel}${variant}.exe"
228230
}
229-
"^4-dev$" {
230-
$downloadUrl = "https://files.lando.dev/core-next/lando-win-${arch}-${Version}.exe"
231+
"^4-(dev|latest)$" {
232+
$downloadUrl = "https://files.lando.dev/core-next/lando-win-${arch}-dev.exe"
231233
}
232-
"^3-dev$" {
234+
"^3-(dev|latest)$" {
233235
$variant = if ($Version -match "^3-" -and !$Fat) { "-slim" } else { "" }
234-
$downloadUrl = "https://files.lando.dev/core/lando-win-${arch}-${Version}${variant}.exe"
236+
$downloadUrl = "https://files.lando.dev/core/lando-win-${arch}-dev${variant}.exe"
235237
}
236238
Default {
237239
Write-Debug "Version '$Version' is a semantic version"
@@ -347,7 +349,7 @@ function Install-Lando {
347349

348350
$filename = $downloadUrl.Split('/')[-1]
349351

350-
Write-Host "Downloading Lando CLI..."
352+
Write-Host "Downloading Lando..."
351353
$downloadDest = "$LANDO_APPDATA\$filename"
352354
Write-Debug "From $downloadUrl to $downloadDest..."
353355
Write-Progress -Activity "Downloading Lando $script:resolvedVersion" -Status "Preparing..." -PercentComplete 0
@@ -597,6 +599,12 @@ Confirm-Environment
597599
# Select the appropriate architecture
598600
$Arch = Select-Architecture
599601

602+
# Remove @lando core if applicable
603+
if (Test-Path "$env:USERPROFILE\.lando\plugins\@lando\core" -ErrorAction SilentlyContinue) {
604+
Write-Debug "Removing detectecd core plugin from $env:USERPROFILE\.lando\plugins\@lando..."
605+
Remove-Item -Path "$env:USERPROFILE\.lando\plugins\@lando\core" -Recurse -Force
606+
}
607+
600608
# Set up our working directory
601609
if (-not (Test-Path "$LANDO_APPDATA" -ErrorAction SilentlyContinue)) {
602610
Write-Debug "Creating destination directory $LANDO_APPDATA..."

dist/setup-lando.sh

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SCRIPT_VERSION="v3.4.5"
1+
SCRIPT_VERSION="v3.5.0"
22
#!/bin/bash
33
set -u
44
# Lando POSIX setup script.
@@ -162,7 +162,7 @@ get_installer_os
162162
# see https://github.blog/changelog/2022-05-24-github-actions-re-run-jobs-with-debug-logging/
163163

164164
# @TODO: no-sudo option
165-
# @TODO: dest
165+
# @TODO: dest based on lmv
166166
ARCH="${LANDO_INSTALLER_ARCH:-"$INSTALLER_ARCH"}"
167167
DEBUG="${LANDO_INSTALLER_DEBUG:-${RUNNER_DEBUG:-}}"
168168
DEST="${LANDO_INSTALLER_DEST:-/usr/local/bin}"
@@ -508,11 +508,18 @@ elif [[ "${VERSION}" == "3-dev" ]] || [[ "${VERSION}" == "3-latest" ]]; then
508508
URL="https://files.lando.dev/core/lando-${OS}-${ARCH}-dev"
509509
VERSION_DEV=1
510510

511-
# CUSTOM
512-
else
513-
if [[ $VERSION != v* ]]; then
514-
VERSION="v${VERSION}"
511+
# CUSTOM VERSION
512+
elif [[ ! -f "$VERSION" ]] && [[ $VERSION != v* ]]; then
513+
VERSION="v${VERSION}"
514+
515+
# PATH VERSION
516+
elif [[ -f "${VERSION}" ]]; then
517+
if [[ "${VERSION}" == /* ]]; then
518+
URL=file://$VERSION
519+
else
520+
URL=file://$(pwd)/$VERSION
515521
fi
522+
VERSION="$($VERSION version)"
516523
fi
517524

518525
# Set some helper things
@@ -526,24 +533,30 @@ else
526533
HRV="$VERSION"
527534
fi
528535

529-
# set url depending on non-dev LMVs
530-
if [[ $LMV == '3' ]] && [[ -z "${VERSION_DEV-}" ]]; then
531-
URL="https://github.com/lando/core/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
532-
elif [[ $LMV == '4' ]] && [[ -z "${VERSION_DEV-}" ]]; then
533-
URL="https://github.com/lando/core-next/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
536+
# if URL is still not set at this point we assume its a github version download
537+
if [[ -z "${URL-}" ]]; then
538+
if [[ $LMV == '3' ]] && [[ -z "${VERSION_DEV-}" ]]; then
539+
URL="https://github.com/lando/core/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
540+
elif [[ $LMV == '4' ]] && [[ -z "${VERSION_DEV-}" ]]; then
541+
URL="https://github.com/lando/core-next/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
542+
fi
543+
fi
544+
545+
# abort if we have no URL at this point
546+
if [[ -z "${URL-}" ]]; then
547+
abort "could not resolve '${ORIGINAL_VERSION}' to a file or URL!"
548+
else
549+
debug "resolved v${LMV} version '${ORIGINAL_VERSION}' to ${VERSION} (${URL})"
534550
fi
535551

536552
# autoslim all v3 urls by default
537-
# @TODO: --fat flag to stop this?
538-
if [[ $LMV == '3' ]] && [[ $FAT != '1' ]]; then
553+
# @TODO: restrict this to 3 < 3.24.0 at some point?
554+
if [[ $URL != file://* ]] && [[ $LMV == '3' ]] && [[ $FAT != '1' ]]; then
539555
URL="${URL}-slim"
540556
HRV="$VERSION-slim"
541557
debug "autoslimin url for lando 3"
542558
fi
543559

544-
# debug version resolution
545-
debug "resolved v${LMV} version '${ORIGINAL_VERSION}' to ${VERSION} (${URL})"
546-
547560
# force setup to 0 if lando 4
548561
if [[ $SETUP == '1' ]] && [[ $LMV == '4' ]]; then
549562
SETUP=0
@@ -771,7 +784,9 @@ if [[ -z "${NONINTERACTIVE-}" ]]; then
771784
# sudo prompt
772785
if needs_sudo; then log "- ${tty_green}prompt${tty_reset} for ${tty_bold}sudo${tty_reset} password"; fi
773786
# download
774-
log "- ${tty_magenta}download${tty_reset} lando ${tty_bold}${HRV}${tty_reset} to ${tty_bold}${DEST}${tty_reset}"
787+
if [[ $URL != file://* ]]; then log "- ${tty_magenta}download${tty_reset} lando ${tty_bold}${HRV}${tty_reset} to ${tty_bold}${DEST}${tty_reset}"
788+
# or move
789+
else log "- ${tty_magenta}move${tty_reset} lando ${tty_bold}${ORIGINAL_VERSION}${tty_reset} to ${tty_bold}${DEST}${tty_reset}"; fi
775790
# setup
776791
if [[ "$SETUP" == "1" ]]; then log "- ${tty_blue}run${tty_reset} ${tty_bold}lando setup${tty_reset}"; fi
777792
# shellenv
@@ -786,14 +801,14 @@ if needs_sudo; then
786801
execute_sudo true
787802
fi
788803

789-
# Create directories if we need to
790-
if [[ ! -d "$DEST" ]]; then auto_exec mkdir -p "$DEST"; fi
791-
if [[ ! -d "$LANDO_TMPDIR" ]]; then auto_exec mkdir -p "$LANDO_TMPDIR"; fi
792-
793804
# LANDO
794805
LANDO="${DEST}/lando"
795806
LANDO_TMPFILE="${LANDO_TMPDIR}/${RANDOM}"
796807

808+
# Create directories if we need to
809+
if [[ ! -d "$DEST" ]]; then auto_exec mkdir -p "$DEST"; fi
810+
if [[ ! -d "$LANDO_TMPDIR" ]]; then auto_exec mkdir -p "$LANDO_TMPDIR"; fi
811+
797812
# download lando
798813
log "${tty_magenta}downloading${tty_reset} ${tty_bold}${URL}${tty_reset} to ${tty_bold}${LANDO}${tty_reset}"
799814
auto_exec curl \
@@ -811,13 +826,21 @@ execute "${LANDO_TMPFILE}" version >/dev/null
811826
# NOTE: we use mv here instead of cp because of https://developer.apple.com/forums/thread/130313
812827
auto_exec mv -f "${LANDO_TMPFILE}" "${LANDO}"
813828

814-
# if lando 3 then --clear
829+
# if lando 3 then we need to do some other cleanup things
830+
# @TODO: is there an equivalent on lando 4?
815831
if [[ $LMV == '3' ]]; then
816-
execute "${LANDO}" --clear >/dev/null
832+
# ensure dirz
833+
execute mkdir -p "$HOME/.lando/bin"
834+
# force symlink landobin to ensure PATH primacy as best we can
835+
execute ln -sf "${LANDO}" "$HOME/.lando/bin/lando"
836+
# remove preexisting lando core so this one can also assert primacy
837+
execute rm -rf "$HOME/.lando/plugins/@lando/core"
838+
# clean
839+
execute "${LANDO}" --clear >/dev/null;
817840
fi
818841

819842
# test via log
820-
log "${tty_green}downloaded${tty_reset} @lando/cli ${tty_bold}$("${LANDO}" version --component @lando/cli)${tty_reset} to ${tty_bold}${LANDO}${tty_reset}"
843+
log "${tty_green}downloaded${tty_reset} lando ${tty_bold}$("${LANDO}" version --component @lando/cli)${tty_reset} to ${tty_bold}${LANDO}${tty_reset}"
821844

822845
# run correct setup flavor if needed
823846
if [[ "$SETUP" == "1" ]]; then

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@lando/setup-lando",
33
"description": "GitHub Action to setup Lando on GitHub Actions.",
4-
"version": "3.4.5",
4+
"version": "3.5.0",
55
"author": "Mike Pirog @pirog",
66
"main": "setup-lando.js",
77
"license": "GPL-3.0",

0 commit comments

Comments
 (0)