Skip to content

Commit

Permalink
release v3.4.0 generated by @lando/prepare-release-action
Browse files Browse the repository at this point in the history
  • Loading branch information
rtfm-47 committed Oct 15, 2024
1 parent 3819e94 commit 4830150
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 44 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

## v3.4.0 - [October 15, 2024](https://github.com/lando/setup-lando/releases/tag/v3.4.0)

## New Features

* Added `LANDO_VERSION` as a way to set the `version` in the install pathways
Expand Down
33 changes: 19 additions & 14 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44713,9 +44713,6 @@ exports.gitHubReleases = [
const isValidUrl = __nccwpck_require__(5142);
const {s3Releases} = __nccwpck_require__(9734);

const s3Base = 'https://files.lando.dev/cli';
const gitHubBase = 'https://github.com/lando/cli/releases/download';

module.exports = (version, {os, architecture, slim = false} = {}) => {
// if version is actually a downlaod url then just return that right away
if (isValidUrl(version)) return version;
Expand Down Expand Up @@ -44747,9 +44744,15 @@ module.exports = (version, {os, architecture, slim = false} = {}) => {
// and add special handling for windows
const filename = os === 'Windows' ? `${parts.join('-')}.exe` : parts.join('-');

// return the correct filename
return s3Releases.includes(version) || version.includes('preview')
? `${s3Base}/${filename}` : `${gitHubBase}/${version}/${filename}`;
// if an s3 release alias
if (s3Releases.includes(version) || version.includes('preview')) {
if (version.includes('4')) return `https://files.lando.dev/core-next/${filename}`;
else return `https://files.lando.dev/core/${filename}`;
}

// otherwise github?
if (version.startsWith('v4')) return `https://github.com/lando/core-next/releases/download/${version}/${filename}`;
else return `https://github.com/lando/core/releases/download/${version}/${filename}`;
};


Expand All @@ -44768,7 +44771,7 @@ const path = __nccwpck_require__(1017);

module.exports = file => {
// if no file then return right away
if (!file) return;
if (!file || file === false) return;

// if file is not absolute then prepend some bases as needed
if (!path.isAbsolute(file)) file = path.join(process.env.GITHUB_WORKSPACE || process.cwd(), file);
Expand Down Expand Up @@ -45031,16 +45034,16 @@ module.exports = (config = {}, pairs = []) => {
"use strict";



module.exports = (command, landoBin = 'lando') => {
// throw if not a string
if (typeof command !== 'string') throw new Error('Setup command must be a string!');
// validate a few things
if (!command.includes('lando setup')) {
throw new Error(`Setup command must include "lando setup"! You tried to run "${command}"`);
}

// return command but with lando invocations replaced with absolute paths to the landoBin
return command.replace(/lando /g, `${landoBin} `);
return command.replace(/lando /g, `"${landoBin.replace(/\\/g, '\\\\')}" `);
};


Expand Down Expand Up @@ -47048,7 +47051,7 @@ var __webpack_exports__ = {};
"use strict";


const SCRIPT_VERSION = 'v3.3.0';
const SCRIPT_VERSION = 'v3.4.0';

const core = __nccwpck_require__(2186);
const exec = __nccwpck_require__(1514);
Expand Down Expand Up @@ -47112,7 +47115,7 @@ const main = async () => {
inputs.setup = inputs.autoSetup ?? inputs.setup;

// determine lando version spec to install
const spec = inputs.landoVersion || getFileVersion(inputs.landoVersionFile) || 'stable';
const spec = inputs.landoVersion || getFileVersion(inputs.landoVersionFile) || get(process, 'env.LANDO_VERSION') || 'stable'; // eslint-disable-line max-len
core.debug(`rolling with "${spec}" as version spec`);

// get a pagination vibed octokit so we can get ALL release data
Expand All @@ -47121,8 +47124,10 @@ const main = async () => {

// try/catch
try {
const releases =
await octokit.paginate('GET /repos/{owner}/{repo}/releases', {owner: 'lando', repo: 'cli', per_page: 100});
const releases = await Promise.all([
await octokit.paginate('GET /repos/{owner}/{repo}/releases', {owner: 'lando', repo: 'core', per_page: 100}),
await octokit.paginate('GET /repos/{owner}/{repo}/releases', {owner: 'lando', repo: 'core-next', per_page: 100}),
].flat(Number.POSITIVE_INFINITY));
core.debug(`found ${releases.length} valid releases`);

// attempt to resolve the spec
Expand Down Expand Up @@ -47242,7 +47247,7 @@ const main = async () => {
} else {
const command = parseSetupCommand(getSetupCommand(inputs.setup), landoPath);
const opts = {env: {...process.env, LANDO_DEBUG: core.isDebug() || inputs.debug}};
await exec.exec('bash', ['-c', command], opts);
await exec.exec(command, [], opts);
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions dist/setup-lando.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const main = async () => {
inputs.setup = inputs.autoSetup ?? inputs.setup;

// determine lando version spec to install
const spec = inputs.landoVersion || getFileVersion(inputs.landoVersionFile) || 'stable';
const spec = inputs.landoVersion || getFileVersion(inputs.landoVersionFile) || get(process, 'env.LANDO_VERSION') || 'stable'; // eslint-disable-line max-len
core.debug(`rolling with "${spec}" as version spec`);

// get a pagination vibed octokit so we can get ALL release data
Expand All @@ -73,8 +73,10 @@ const main = async () => {

// try/catch
try {
const releases =
await octokit.paginate('GET /repos/{owner}/{repo}/releases', {owner: 'lando', repo: 'cli', per_page: 100});
const releases = await Promise.all([
await octokit.paginate('GET /repos/{owner}/{repo}/releases', {owner: 'lando', repo: 'core', per_page: 100}),
await octokit.paginate('GET /repos/{owner}/{repo}/releases', {owner: 'lando', repo: 'core-next', per_page: 100}),
].flat(Number.POSITIVE_INFINITY));
core.debug(`found ${releases.length} valid releases`);

// attempt to resolve the spec
Expand Down Expand Up @@ -194,7 +196,7 @@ const main = async () => {
} else {
const command = parseSetupCommand(getSetupCommand(inputs.setup), landoPath);
const opts = {env: {...process.env, LANDO_DEBUG: core.isDebug() || inputs.debug}};
await exec.exec('bash', ['-c', command], opts);
await exec.exec(command, [], opts);
}
}

Expand Down
36 changes: 28 additions & 8 deletions dist/setup-lando.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ param(
[switch]$Help
)

$SCRIPT_VERSION = "v3.3.0"
# If version is "stable" AND LANDO_VERSION is set (and not empty), then prefer the version from LANDO_VERSION
if ($env:LANDO_VERSION -ne $null -and $env:LANDO_VERSION -ne "" -and $Version -eq "stable") {
$Version = $env:LANDO_VERSION
}

$SCRIPT_VERSION = "v3.4.0"
$LANDO_DEFAULT_MV = "3"
$LANDO_SETUP_PS1_URL = "https://get.lando.dev/setup-lando.ps1"
$LANDO_SETUP_SH_URL = "https://get.lando.dev/setup-lando.sh"
Expand Down Expand Up @@ -189,7 +194,8 @@ function Resolve-VersionAlias {

Write-Debug "Resolving version alias '$Version'..."
$originalVersion = $Version
$baseUrl = "https://github.com/lando/cli/releases/download/"
$baseUrl3 = "https://github.com/lando/core/releases/download/"
$baseUrl4 = "https://github.com/lando/core-next/releases/download/"

$aliasMap = @{
"3" = "3-stable";
Expand All @@ -208,22 +214,36 @@ function Resolve-VersionAlias {
# Resolve release aliases to download URLs.
# Default to slim variant for 3.x unless -Fat is specified.
switch -Regex ($Version) {
"^(3|4)-(stable|edge)$" {
"^4-(stable|edge)$" {
Write-Debug "Fetching release alias '$($Version.ToUpper())' from GitHub..."
$VersionLabel = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/lando/core-next/main/release-aliases/$($Version.ToUpper())" -UseBasicParsing).Content -replace '\s'
$variant = if ($Version -match "^3-" -and !$Fat) { "-slim" } else { "" }
$downloadUrl = "${baseUrl4}${VersionLabel}/lando-win-${arch}-${VersionLabel}${variant}.exe"
}
"^3-(stable|edge)$" {
Write-Debug "Fetching release alias '$($Version.ToUpper())' from GitHub..."
$VersionLabel = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/lando/cli/main/release-aliases/$($Version.ToUpper())" -UseBasicParsing).Content -replace '\s'
$VersionLabel = (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/lando/core/main/release-aliases/$($Version.ToUpper())" -UseBasicParsing).Content -replace '\s'
$variant = if ($Version -match "^3-" -and !$Fat) { "-slim" } else { "" }
$downloadUrl = "${baseUrl}${VersionLabel}/lando-win-${arch}-${VersionLabel}${variant}.exe"
$downloadUrl = "${baseUrl3}${VersionLabel}/lando-win-${arch}-${VersionLabel}${variant}.exe"
}
"^4-dev$" {
$downloadUrl = "https://files.lando.dev/core-next/lando-win-${arch}-${Version}.exe"
}
"^(3|4)-dev$" {
"^3-dev$" {
$variant = if ($Version -match "^3-" -and !$Fat) { "-slim" } else { "" }
$downloadUrl = "https://files.lando.dev/cli/lando-win-${arch}-${Version}${variant}.exe"
$downloadUrl = "https://files.lando.dev/core/lando-win-${arch}-${Version}${variant}.exe"
}
Default {
Write-Debug "Version '$Version' is a semantic version"
if (-not $Version.StartsWith("v")) {
$Version = "v$Version"
}
$downloadUrl = "${baseUrl}${Version}/lando-win-${arch}-${Version}.exe"
if ($Version.StartsWith("v4")) {
$downloadUrl = "${baseUrl4}${Version}/lando-win-${arch}-${Version}.exe"
}
else {
$downloadUrl = "${baseUrl3}${Version}/lando-win-${arch}-${Version}.exe"
}
}
}

Expand Down
30 changes: 15 additions & 15 deletions dist/setup-lando.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SCRIPT_VERSION="v3.3.0"
SCRIPT_VERSION="v3.4.0"
#!/bin/bash
set -u
# Lando POSIX setup script.
Expand Down Expand Up @@ -170,7 +170,7 @@ FAT="${LANDO_INSTALLER_FAT:-0}"
OS="${LANDO_INSTALLER_OS:-"$INSTALLER_OS"}"
SUDO="${LANDO_INSTALLER_SUDO:-1}"
SETUP="${LANDO_INSTALLER_SETUP:-1}"
VERSION="${LANDO_INSTALLER_VERSION:-"stable"}"
VERSION="${LANDO_VERSION:-${LANDO_INSTALLER_VERSION:-stable}}"
ORIGOPTS="$*"

usage() {
Expand Down Expand Up @@ -489,37 +489,30 @@ fi

# STABLE
if [[ "${VERSION}" == "4-stable" ]]; then
VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/cli/main/release-aliases/4-STABLE | tr -s '[:blank:]')"
URL="https://github.com/lando/cli/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"

VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/core-next/main/release-aliases/4-STABLE | tr -s '[:blank:]')"
elif [[ "${VERSION}" == "3-stable" ]]; then
VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/cli/main/release-aliases/3-STABLE | tr -s '[:blank:]')"
URL="https://github.com/lando/cli/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/core/main/release-aliases/3-STABLE | tr -s '[:blank:]')"

# EDGE
elif [[ "${VERSION}" == "4-edge" ]]; then
VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/cli/main/release-aliases/4-EDGE | tr -s '[:blank:]')"
URL="https://github.com/lando/cli/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"

VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/core-next/main/release-aliases/4-EDGE | tr -s '[:blank:]')"
elif [[ "${VERSION}" == "3-edge" ]]; then
VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/cli/main/release-aliases/3-EDGE | tr -s '[:blank:]')"
URL="https://github.com/lando/cli/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
VERSION="$($CURL -fsSL https://raw.githubusercontent.com/lando/core/main/release-aliases/3-EDGE | tr -s '[:blank:]')"

# DEV
elif [[ "${VERSION}" == "4-dev" ]] || [[ "${VERSION}" == "4-latest" ]]; then
URL="https://files.lando.dev/cli/lando-${OS}-${ARCH}-dev"
URL="https://files.lando.dev/core-next/lando-${OS}-${ARCH}-dev"
VERSION_DEV=1

elif [[ "${VERSION}" == "3-dev" ]] || [[ "${VERSION}" == "3-latest" ]]; then
URL="https://files.lando.dev/cli/lando-${OS}-${ARCH}-dev"
URL="https://files.lando.dev/core/lando-${OS}-${ARCH}-dev"
VERSION_DEV=1

# CUSTOM
else
if [[ $VERSION != v* ]]; then
VERSION="v${VERSION}"
fi
URL="https://github.com/lando/cli/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
fi

# Set some helper things
Expand All @@ -533,6 +526,13 @@ else
HRV="$VERSION"
fi

# set url depending on non-dev LMVs
if [[ $LMV == '3' ]] && [[ -z "${VERSION_DEV-}" ]]; then
URL="https://github.com/lando/core/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
elif [[ $LMV == '4' ]] && [[ -z "${VERSION_DEV-}" ]]; then
URL="https://github.com/lando/core-next/releases/download/${VERSION}/lando-${OS}-${ARCH}-${VERSION}"
fi

# autoslim all v3 urls by default
# @TODO: --fat flag to stop this?
if [[ $LMV == '3' ]] && [[ $FAT != '1' ]]; then
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@lando/setup-lando",
"description": "GitHub Action to setup Lando on GitHub Actions.",
"version": "3.3.0",
"version": "3.4.0",
"author": "Mike Pirog @pirog",
"main": "setup-lando.js",
"license": "GPL-3.0",
Expand Down

0 comments on commit 4830150

Please sign in to comment.