From 6320c519dc6bc6dd65a42e0db9d06ecec8b13e27 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 16 Dec 2024 00:54:42 +0000 Subject: [PATCH] fix(terraform): correct channel for stable and non-stable (rc, beta, alpha) --- terraform/releases.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/terraform/releases.js b/terraform/releases.js index 4a82a69ad..7c5cd3f88 100644 --- a/terraform/releases.js +++ b/terraform/releases.js @@ -2,6 +2,10 @@ let Fetcher = require('../_common/fetcher.js'); +let alphaRe = /\d-alpha\d/; +let betaRe = /\d-beta\d/; +let rcRe = /\d-rc\d/; + /** * @typedef BuildInfo * @prop {String} version @@ -36,6 +40,18 @@ async function getDistributables() { for (let version of allVersions) { for (let build of releases.versions[version].builds) { + let channel = 'stable'; + let isRc = rcRe.test(version); + let isBeta = betaRe.test(version); + let isAlpha = alphaRe.test(version); + if (isRc) { + channel = 'rc'; + } else if (isBeta) { + channel = 'beta'; + } else if (isAlpha) { + channel = 'alpha'; + } + let r = { version: build.version, download: build.url, @@ -43,7 +59,7 @@ async function getDistributables() { // and the per-file logic has proven to get outdated sooner //os: convert[build.os], //arch: convert[build.arch], - //channel: 'stable|-rc|-beta|-alpha', + channel: channel, }; all.releases.push(r); }