diff --git a/config/release-package-matrix.d.ts b/config/release-package-matrix.d.ts index f37e3c8dd..a6dcb0077 100644 --- a/config/release-package-matrix.d.ts +++ b/config/release-package-matrix.d.ts @@ -8,6 +8,7 @@ export interface PackageInformation { name: string; description: string; packageOn: string; + packageType: string; smokeTestKind: 'docker' | 'rpmextract' | 'debextract' | 'none'; smokeTestDockerfiles?: string[]; serverLikeTargetList: string[]; diff --git a/config/release-package-matrix.js b/config/release-package-matrix.js index 0e3cd89d1..96779204b 100644 --- a/config/release-package-matrix.js +++ b/config/release-package-matrix.js @@ -8,97 +8,113 @@ const rhel70AndAboveAndRpmBased = ['rhel70', 'rhel71', ...rhel72AndAbove, 'amazo const ubuntu1804AndAboveAndDebBased = ['ubuntu1804', 'ubuntu1804', 'ubuntu2004', 'ubuntu2204', 'debian10', 'debian11', 'debian12'] const allLinux = [...rhel70AndAboveAndRpmBased, ...ubuntu1804AndAboveAndDebBased] +const publicDescriptions = { + darwin_x64: 'MacOS x64 (11.0+)', + darwin_arm64: 'MacOS M1 (11.0+)', + linux_x64: 'Linux x64', + linux_arm64: 'Linux arm64', + debian_x64: 'Debian (11+) / Ubuntu (20.04+) x64', + debian_arm64: 'Debian (11+) / Ubuntu (20.04+) arm64', + rhel_x64: 'RHEL / CentOS (8+) x64', + rhel_arm64: 'RHEL / CentOS (8+) arm64', + linux_ppc64le: 'Linux ppc64le', + rhel_ppc64le: 'RHEL / CentOS (8+) ppc64le', + linux_s390x: 'Linux ppc64le', + rhel_s390x: 'RHEL / CentOS (8+) ppc64le', + win32_x64: 'Windows x64 (10+)' +}; + exports.RELEASE_PACKAGE_MATRIX = [ { executableOsId: 'darwin-x64', compileBuildVariant: 'darwin', packages: [ - { name: 'darwin-x64', description: 'MacOS 64-bit (10.14+)', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } + { name: 'darwin-x64', description: publicDescriptions.darwin_x64, packageType: 'zip', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } ] }, { executableOsId: 'darwin-arm64', compileBuildVariant: 'darwin_arm64', packages: [ - { name: 'darwin-arm64', description: 'MacOS M1 (11.0+)', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } + { name: 'darwin-arm64', description: publicDescriptions.darwin_arm64, packageType: 'zip', packageOn: 'darwin', smokeTestKind: 'macos', serverLikeTargetList: ['macos'] } ] }, { executableOsId: 'linux-x64', compileBuildVariant: 'linux_x64_build', packages: [ - { name: 'linux-x64', description: 'Linux Tarball 64-bit', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...allLinux] }, - { name: 'deb-x64', description: 'Debian / Ubuntu 64-bit', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'ubuntu22.04-nohome-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-x64', description: 'RHEL / CentOS / Fedora / Suse 64-bit', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'suse12-rpm', 'suse15-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } + { name: 'linux-x64', description: publicDescriptions.linux_x64, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...allLinux] }, + { name: 'deb-x64', description: publicDescriptions.debian_x64, packageType: 'deb', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'ubuntu22.04-nohome-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-x64', description: publicDescriptions.rhel_x64, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'suse12-rpm', 'suse15-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } ] }, { executableOsId: 'linux-x64-openssl11', compileBuildVariant: 'linux_x64_build_openssl11', packages: [ - { name: 'linux-x64-openssl11', description: 'Linux Tarball 64-bit (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, - { name: 'deb-x64-openssl11', description: 'Debian / Ubuntu 64-bit (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-x64-openssl11', description: 'RHEL / CentOS 64-bit (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-epel-rpm', 'amazonlinux2-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } + { name: 'linux-x64-openssl11', description: publicDescriptions.linux_x64, packageType: 'tgz with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, + { name: 'deb-x64-openssl11', description: publicDescriptions.debian_x64, packageType: 'deb with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-x64-openssl11', description: publicDescriptions.rhel_x64, packageType: 'rpm with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['centos7-epel-rpm', 'amazonlinux2-rpm', 'rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } ] }, { executableOsId: 'linux-x64-openssl3', compileBuildVariant: 'linux_x64_build_openssl3', packages: [ - { name: 'linux-x64-openssl3', description: 'Linux Tarball 64-bit (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, - { name: 'deb-x64-openssl3', description: 'Debian / Ubuntu 64-bit (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-x64-openssl3', description: 'RHEL / CentOS 64-bit (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } + { name: 'linux-x64-openssl3', description: publicDescriptions.linux_x64, packageType: 'tgz with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...allLinux] }, + { name: 'deb-x64-openssl3', description: publicDescriptions.debian_x64, packageType: 'deb with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-x64-openssl3', description: publicDescriptions.rhel_x64, packageType: 'rpm with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...rhel70AndAboveAndRpmBased] } ] }, { executableOsId: 'linux-arm64', compileBuildVariant: 'linux_arm64_build', packages: [ - { name: 'linux-arm64', description: 'Linux Tarball arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...al2AndAbove] }, - { name: 'deb-arm64', description: 'Debian / Ubuntu arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-arm64', description: 'RHEL / CentOS arm64', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } + { name: 'linux-arm64', description: publicDescriptions.linux_arm64, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-tgz'], serverLikeTargetList: [...al2AndAbove] }, + { name: 'deb-arm64', description: publicDescriptions.debian_arm64, packageType: 'deb', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu18.04-deb', 'ubuntu20.04-deb', 'ubuntu22.04-deb', 'debian10-deb', 'debian11-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-arm64', description: publicDescriptions.rhel_arm64, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } ] }, { executableOsId: 'linux-arm64-openssl11', compileBuildVariant: 'linux_arm64_build_openssl11', packages: [ - { name: 'linux-arm64-openssl11', description: 'Linux Tarball arm64 (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, - { name: 'deb-arm64-openssl11', description: 'Debian / Ubuntu arm64 (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-arm64-openssl11', description: 'Redhat / Centos arm64 (shared OpenSSL 1.1)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm'], serverLikeTargetList: [...al2AndAbove] } + { name: 'linux-arm64-openssl11', description: publicDescriptions.linux_arm64, packageType: 'tgz with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, + { name: 'deb-arm64-openssl11', description: publicDescriptions.debian_arm64, packageType: 'deb with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu20.04-deb', 'debian10-deb', 'debian11-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-arm64-openssl11', description: publicDescriptions.rhel_arm64, packageType: 'rpm with shared OpenSSL 1.1', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-rpm', 'rocky9-rpm', 'fedora34-rpm', 'amazonlinux2-rpm'], serverLikeTargetList: [...al2AndAbove] } ] }, { executableOsId: 'linux-arm64-openssl3', compileBuildVariant: 'linux_arm64_build_openssl3', packages: [ - { name: 'linux-arm64-openssl3', description: 'Linux Tarball arm64 (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, - { name: 'deb-arm64-openssl3', description: 'Debian / Ubuntu arm64 (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, - { name: 'rpm-arm64-openssl3', description: 'RHEL / CentOS arm64 (shared OpenSSL 3)', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } + { name: 'linux-arm64-openssl3', description: publicDescriptions.linux_arm64, packageType: 'tgz with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...al2AndAbove] }, + { name: 'deb-arm64-openssl3', description: publicDescriptions.debian_arm64, packageType: 'deb with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['ubuntu22.04-deb', 'ubuntu22.04-fips-deb', 'debian12-deb'], serverLikeTargetList: [...ubuntu1804AndAboveAndDebBased] }, + { name: 'rpm-arm64-openssl3', description: publicDescriptions.rhel_arm64, packageType: 'rpm with shared OpenSSL 3', packageOn: 'linux_package', smokeTestKind: 'docker', smokeTestDockerfiles: ['rocky8-epel-rpm', 'rocky9-rpm', 'rocky9-fips-rpm', 'amazonlinux2023-rpm'], serverLikeTargetList: [...al2AndAbove] } ] }, { executableOsId: 'linux-ppc64le', compileBuildVariant: 'linux_ppc64le_build', packages: [ - { name: 'linux-ppc64le', description: 'Linux Tarball ppc64le', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel81AndAbove] }, - { name: 'rpm-ppc64le', description: 'Redhat / Centos ppc64le', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel81AndAbove] } + { name: 'linux-ppc64le', description: publicDescriptions.linux_ppc64le, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel81AndAbove] }, + { name: 'rpm-ppc64le', description: publicDescriptions.rhel_ppc64le, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel81AndAbove] } ] }, { executableOsId: 'linux-s390x', compileBuildVariant: 'linux_s390x_build', packages: [ - { name: 'linux-s390x', description: 'Linux Tarball s390x', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel72AndAbove] }, - { name: 'rpm-s390x', description: 'Redhat / Centos s390x', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel72AndAbove] } + { name: 'linux-s390x', description: publicDescriptions.linux_s390x, packageType: 'tgz', packageOn: 'linux_package', smokeTestKind: 'none', serverLikeTargetList: [...rhel72AndAbove] }, + { name: 'rpm-s390x', description: publicDescriptions.rhel_s390x, packageType: 'rpm', packageOn: 'linux_package', smokeTestKind: 'rpmextract', serverLikeTargetList: [...rhel72AndAbove] } ] }, { executableOsId: 'win32', compileBuildVariant: 'win32_build', packages: [ - { name: 'win32-x64', description: 'Windows 64-bit (8.1+)', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] }, - { name: 'win32msi-x64', description: 'Windows 64-bit (8.1+) (MSI)', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] } + { name: 'win32-x64', description: publicDescriptions.win32_x64, packageType: 'zip', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] }, + { name: 'win32msi-x64', description: publicDescriptions.win32_x64, packageType: 'msi', packageOn: 'win32', smokeTestKind: 'ssh', serverLikeTargetList: ['windows'] } ] } ]; diff --git a/package-lock.json b/package-lock.json index bcd800d1b..a09401cd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30897,7 +30897,7 @@ "license": "Apache-2.0", "dependencies": { "@mongodb-js/devtools-github-repo": "^1.0.1", - "@mongodb-js/dl-center": "^1.0.1", + "@mongodb-js/dl-center": "^1.1.1", "@mongodb-js/mongodb-downloader": "^0.2.7", "@octokit/rest": "^17.9.0", "aws-sdk": "^2.674.0", @@ -37759,7 +37759,7 @@ "version": "file:packages/build", "requires": { "@mongodb-js/devtools-github-repo": "^1.0.1", - "@mongodb-js/dl-center": "^1.0.1", + "@mongodb-js/dl-center": "^1.1.1", "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/mongodb-downloader": "^0.2.7", "@mongodb-js/monorepo-tools": "^1.1.10", diff --git a/packages/build/package.json b/packages/build/package.json index 7f0e4ccaa..c8913e923 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -62,7 +62,7 @@ "dependencies": { "@mongodb-js/devtools-github-repo": "^1.0.1", "@mongodb-js/mongodb-downloader": "^0.2.7", - "@mongodb-js/dl-center": "^1.0.1", + "@mongodb-js/dl-center": "^1.1.1", "@octokit/rest": "^17.9.0", "aws-sdk": "^2.674.0", "boxednode": "^2.1.1", diff --git a/packages/build/src/config/build-variant.ts b/packages/build/src/config/build-variant.ts index 2fba32bde..e6964e6c9 100644 --- a/packages/build/src/config/build-variant.ts +++ b/packages/build/src/config/build-variant.ts @@ -114,3 +114,15 @@ export function getDownloadCenterDistroDescription( throw new Error(`${variant} is not a valid build variant`); } + +export function getDownloadCenterPackageType(variant: PackageVariant): string { + for (const { packages } of RELEASE_PACKAGE_MATRIX) { + for (const pkg of packages) { + if (pkg.name === variant) { + return pkg.packageType; + } + } + } + + throw new Error(`${variant} is not a valid build variant`); +} diff --git a/packages/build/src/download-center/config.spec.ts b/packages/build/src/download-center/config.spec.ts index ac039c01f..ade97a68e 100644 --- a/packages/build/src/download-center/config.spec.ts +++ b/packages/build/src/download-center/config.spec.ts @@ -43,23 +43,25 @@ describe('DownloadCenter config', function () { it('has an artifact for darwin', function () { const version = createVersionConfig(packageInformation('1.2.2')); - const platforms = version.platform.filter((p) => p.os === 'darwin'); - expect(platforms).to.have.length(2); - expect(platforms[0].download_link).to.include( - 'mongosh-1.2.2-darwin-x64.zip' + const platforms = version.platform.filter( + (p) => p.os === 'MacOS x64 (11.0+)' ); - expect(platforms[1].download_link).to.include( - 'mongosh-1.2.2-darwin-arm64.zip' + expect(platforms).to.have.length(1); + expect(platforms[0].packages.links[0].name).to.include('zip'); + expect(platforms[0].packages.links[0].download_link).to.include( + 'mongosh-1.2.2-darwin-x64.zip' ); }); it('has an artifact for linux', function () { const version = createVersionConfig(packageInformation('1.2.2')); const platforms = version.platform.filter( - (p) => p.os === 'linux' && p.arch === 'x64' + (p) => p.os.startsWith('Linux x64') && p.arch === 'x64' ); - expect(platforms).to.have.length(3); - expect(platforms.map((p) => p.download_link)).to.deep.equal([ + expect(platforms).to.have.length(1); + expect( + platforms.flatMap((p) => p.packages.links.map((l) => l.download_link)) + ).to.deep.equal([ 'https://downloads.mongodb.com/compass/mongosh-1.2.2-linux-x64.tgz', 'https://downloads.mongodb.com/compass/mongosh-1.2.2-linux-x64-openssl11.tgz', 'https://downloads.mongodb.com/compass/mongosh-1.2.2-linux-x64-openssl3.tgz', @@ -68,23 +70,26 @@ describe('DownloadCenter config', function () { it('has an MSI and ZIP artifacts for windows', function () { const version = createVersionConfig(packageInformation('1.2.2')); - const platforms = version.platform.filter( - (p) => p.os === 'win32' || p.os === 'win32msi' + const [platform] = version.platform.filter( + (p) => p.os === 'Windows x64 (10+)' ); - expect(platforms).to.have.length(2); - expect(platforms.map((p) => p.download_link)).to.deep.equal([ - 'https://downloads.mongodb.com/compass/mongosh-1.2.2-win32-x64.zip', - 'https://downloads.mongodb.com/compass/mongosh-1.2.2-x64.msi', - ]); + expect(platform.packages.links[0].download_link).to.contain( + 'win32-x64.zip' + ); + expect(platform.packages.links[0].name).to.equal('zip'); + expect(platform.packages.links[1].download_link).to.contain('x64.msi'); + expect(platform.packages.links[1].name).to.contain('msi'); }); it('has an artifact for rpm', function () { const version = createVersionConfig(packageInformation('1.2.2')); const platforms = version.platform.filter( - (p) => p.os === 'rpm' && p.arch === 'x64' + (p) => p.os.startsWith('RHEL') && p.arch === 'x64' ); - expect(platforms).to.have.length(3); - expect(platforms.map((p) => p.download_link)).to.deep.equal([ + expect(platforms).to.have.length(1); + expect( + platforms.flatMap((p) => p.packages.links.map((l) => l.download_link)) + ).to.deep.equal([ 'https://downloads.mongodb.com/compass/mongodb-mongosh-1.2.2.x86_64.rpm', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11-1.2.2.x86_64.rpm', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3-1.2.2.x86_64.rpm', @@ -94,10 +99,12 @@ describe('DownloadCenter config', function () { it('has an artifact for deb', function () { const version = createVersionConfig(packageInformation('1.2.2')); const platforms = version.platform.filter( - (p) => p.os === 'deb' && p.arch === 'x64' + (p) => p.os.startsWith('Debian') && p.arch === 'x64' ); - expect(platforms).to.have.length(3); - expect(platforms.map((p) => p.download_link)).to.deep.equal([ + expect(platforms).to.have.length(1); + expect( + platforms.flatMap((p) => p.packages.links.map((l) => l.download_link)) + ).to.deep.equal([ 'https://downloads.mongodb.com/compass/mongodb-mongosh_1.2.2_amd64.deb', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11_1.2.2_amd64.deb', 'https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_1.2.2_amd64.deb', @@ -124,7 +131,7 @@ describe('DownloadCenter config', function () { describe('getUpdatedDownloadCenterConfig', function () { context('when the current release is a new major bump', function () { - it('adds a new entry for the current release to the download center config, while keeping the other major versions', function () { + it('adds a new entry for the current release to the download center config, while keeping the other major versions, sorted by semver', function () { const getVersionConfig1x = sinon.stub().returns({ version: '1.2.2' }); const getVersionConfig2x = sinon.stub().returns({ version: '2.0.0' }); const existingDownloadCenterConfig = @@ -137,7 +144,7 @@ describe('DownloadCenter config', function () { ); expect(updatedConfig).to.deep.equal({ - versions: [{ version: '1.2.2' }, { version: '2.0.0' }], + versions: [{ version: '2.0.0' }, { version: '1.2.2' }], manual_link: 'https://docs.mongodb.org/manual/products/mongosh', release_notes_link: `https://github.com/mongodb-js/mongosh/releases/tag/v2.0.0`, // Release notes link will point to the current release being made previous_releases_link: '', @@ -169,7 +176,7 @@ describe('DownloadCenter config', function () { ); expect(configWith21x).to.deep.equal({ - versions: [{ version: '1.2.2' }, { version: '2.1.0' }], + versions: [{ version: '2.1.0' }, { version: '1.2.2' }], manual_link: 'https://docs.mongodb.org/manual/products/mongosh', release_notes_link: `https://github.com/mongodb-js/mongosh/releases/tag/v2.1.0`, // Release notes link will point to the current release being made previous_releases_link: '', @@ -219,6 +226,65 @@ describe('DownloadCenter config', function () { }); context('when a configuration does not exist', function () { + it('publishes the created configuration with the fallback provided in fallback.json', async function () { + downloadConfig.throws({ code: 'NoSuchKey' }); + + await createAndPublishDownloadCenterConfig( + packageInformation('2.0.1'), + 'accessKey', + 'secretKey', + '', + false, + dlCenter as any, + baseUrl + ); + + expect(dlCenter).to.have.been.calledWith({ + bucket: 'info-mongodb-com', + accessKeyId: 'accessKey', + secretAccessKey: 'secretKey', + }); + expect(dlCenter).to.have.been.calledWith({ + bucket: 'downloads.10gen.com', + accessKeyId: 'accessKey', + secretAccessKey: 'secretKey', + }); + + expect(uploadConfig).to.be.calledOnce; + + const [uploadKey, uploadedConfig] = uploadConfig.lastCall.args; + expect(uploadKey).to.equal( + 'com-download-center/mongosh.multiversion.json' + ); + + // Versions have platform info as well which we already verify in + // createVersionConfig specs hence trimming it down here + uploadedConfig.versions = ( + uploadedConfig as DownloadCenterConfig + ).versions.map((version) => ({ + ...version, + platform: [], + })); + + expect(uploadedConfig).to.deep.equal({ + versions: [ + { _id: '2.0.1', version: '2.0.1', platform: [] }, + { _id: '1.10.6', version: '1.10.6', platform: [] }, + ], + manual_link: 'https://docs.mongodb.org/manual/products/mongosh', + release_notes_link: + 'https://github.com/mongodb-js/mongosh/releases/tag/v2.0.1', + previous_releases_link: '', + development_releases_link: '', + supported_browsers_link: '', + tutorial_link: 'test', + }); + + expect(uploadAsset).to.be.calledOnce; + const [assetKey] = uploadAsset.lastCall.args; + expect(assetKey).to.equal('compass/mongosh.json'); + }); + it('publishes the created configuration', async function () { await createAndPublishDownloadCenterConfig( packageInformation('1.2.2'), @@ -244,7 +310,9 @@ describe('DownloadCenter config', function () { expect(uploadConfig).to.be.calledOnce; const [uploadKey, uploadedConfig] = uploadConfig.lastCall.args; - expect(uploadKey).to.equal('com-download-center/mongosh.json'); + expect(uploadKey).to.equal( + 'com-download-center/mongosh.multiversion.json' + ); // Versions have platform info as well which we already verify in // createVersionConfig specs hence trimming it down here @@ -346,7 +414,9 @@ describe('DownloadCenter config', function () { expect(uploadConfig).to.be.calledOnce; const [uploadKey, uploadedConfig] = uploadConfig.lastCall.args; - expect(uploadKey).to.equal('com-download-center/mongosh.json'); + expect(uploadKey).to.equal( + 'com-download-center/mongosh.multiversion.json' + ); // Versions have platform info as well which we already verify in // createVersionConfig specs hence trimming it down here @@ -359,8 +429,8 @@ describe('DownloadCenter config', function () { expect(uploadedConfig).to.deep.equal({ versions: [ - { _id: '1.2.2', version: '1.2.2', platform: [] }, { _id: '2.0.0', version: '2.0.0', platform: [] }, + { _id: '1.2.2', version: '1.2.2', platform: [] }, ], manual_link: 'https://docs.mongodb.org/manual/products/mongosh', release_notes_link: diff --git a/packages/build/src/download-center/config.ts b/packages/build/src/download-center/config.ts index 4c3414bc1..1a2c54a63 100644 --- a/packages/build/src/download-center/config.ts +++ b/packages/build/src/download-center/config.ts @@ -3,13 +3,17 @@ import { validateConfigSchema, } from '@mongodb-js/dl-center'; import { major as majorVersion } from 'semver'; -import type { DownloadCenterConfig } from '@mongodb-js/dl-center/dist/download-center-config'; +import type { + DownloadCenterConfig, + PlatformWithPackages, +} from '@mongodb-js/dl-center/dist/download-center-config'; import { ARTIFACTS_BUCKET, ARTIFACTS_FOLDER, ARTIFACTS_URL_PUBLIC_BASE, CONFIGURATION_KEY, CONFIGURATIONS_BUCKET, + ARTIFACTS_FALLBACK, } from './constants'; import type { PackageVariant } from '../config'; import { @@ -19,6 +23,7 @@ import { getDistro, getServerLikeArchName, getServerLikeTargetList, + getDownloadCenterPackageType, } from '../config'; import type { PackageInformationProvider } from '../packaging'; import { getPackageFile } from '../packaging'; @@ -53,7 +58,11 @@ export async function createAndPublishDownloadCenterConfig( ); } catch (err: any) { console.warn('Failed to get existing download center config', err); - if (err?.code !== 'NoSuchKey') throw err; + if (err?.code !== 'NoSuchKey') { + throw err; + } else { + existingDownloadCenterConfig = { ...ARTIFACTS_FALLBACK }; + } } const getVersionConfig = () => @@ -139,6 +148,8 @@ export function getUpdatedDownloadCenterConfig( currentVersions[matchingMajorVersionIdx] = versionConfig; } + currentVersions.sort((a, b) => semver.rcompare(a.version, b.version)); + return { ...downloadedConfig, versions: currentVersions, @@ -166,18 +177,31 @@ export function createVersionConfig( publicArtifactBaseUrl: string = ARTIFACTS_URL_PUBLIC_BASE ) { const { version } = packageInformation('linux-x64').metadata; - return { - _id: version, - version: version, - platform: ALL_PACKAGE_VARIANTS.map((packageVariant: PackageVariant) => ({ + const platformMap: Map = new Map(); + + for (const packageVariant of ALL_PACKAGE_VARIANTS) { + const platformName = getDownloadCenterDistroDescription(packageVariant); + const currentPlatform = platformMap.get(platformName) || { arch: getArch(packageVariant), - os: getDistro(packageVariant), - name: getDownloadCenterDistroDescription(packageVariant), + os: getDownloadCenterDistroDescription(packageVariant), + packages: { links: [] }, + }; + + currentPlatform.packages.links.push({ + name: getDownloadCenterPackageType(packageVariant), download_link: publicArtifactBaseUrl + getPackageFile(packageVariant, packageInformation).path, - })), - } as const; + }); + + platformMap.set(platformName, currentPlatform); + } + + return { + _id: version, + version: version, + platform: [...platformMap.values()], + }; } interface JsonFeed { diff --git a/packages/build/src/download-center/constants.ts b/packages/build/src/download-center/constants.ts index 17fb599a4..b3d953fd3 100644 --- a/packages/build/src/download-center/constants.ts +++ b/packages/build/src/download-center/constants.ts @@ -1,3 +1,5 @@ +const fallback = require('./fallback.json'); + /** * The S3 bucket for download center configurations. */ @@ -6,7 +8,8 @@ export const CONFIGURATIONS_BUCKET = 'info-mongodb-com' as const; /** * The S3 object key for the download center configuration. */ -export const CONFIGURATION_KEY = 'com-download-center/mongosh.json' as const; +export const CONFIGURATION_KEY = + 'com-download-center/mongosh.multiversion.json' as const; /** * The S3 bucket for download center artifacts. @@ -20,3 +23,5 @@ export const ARTIFACTS_FOLDER = 'compass' as const; export const ARTIFACTS_URL_PUBLIC_BASE = 'https://downloads.mongodb.com/compass/' as const; + +export const ARTIFACTS_FALLBACK = Object.freeze(fallback); diff --git a/packages/build/src/download-center/fallback.json b/packages/build/src/download-center/fallback.json new file mode 100644 index 000000000..7e1284a8b --- /dev/null +++ b/packages/build/src/download-center/fallback.json @@ -0,0 +1,334 @@ +{ + "versions": [ + { + "_id": "1.10.6", + "version": "1.10.6", + "platform": [ + { + "arch": "x64", + "os": "darwin", + "name": "MacOS 64-bit (10.14+)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-darwin-x64.zip" + }, + { + "arch": "arm64", + "os": "darwin", + "name": "MacOS M1 (11.0+)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-darwin-arm64.zip" + }, + { + "arch": "x64", + "os": "linux", + "name": "Linux Tarball 64-bit", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-x64.tgz" + }, + { + "arch": "x64", + "os": "deb", + "name": "Debian / Ubuntu 64-bit", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh_1.10.6_amd64.deb" + }, + { + "arch": "x64", + "os": "rpm", + "name": "RHEL / CentOS / Fedora / Suse 64-bit", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-1.10.6.x86_64.rpm" + }, + { + "arch": "x64", + "os": "linux", + "name": "Linux Tarball 64-bit (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-x64-openssl11.tgz" + }, + { + "arch": "x64", + "os": "deb", + "name": "Debian / Ubuntu 64-bit (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11_1.10.6_amd64.deb" + }, + { + "arch": "x64", + "os": "rpm", + "name": "RHEL / CentOS 64-bit (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_1.10.6_amd64.deb" + }, + { + "arch": "x64", + "os": "linux", + "name": "Linux Tarball 64-bit (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-x64-openssl3.tgz" + }, + { + "arch": "x64", + "os": "deb", + "name": "Debian / Ubuntu 64-bit (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_1.10.6_arm64.deb" + }, + { + "arch": "x64", + "os": "rpm", + "name": "RHEL / CentOS 64-bit (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_1.10.6_arm64.deb" + }, + { + "arch": "arm64", + "os": "linux", + "name": "Linux Tarball arm64", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-arm64.tgz" + }, + { + "arch": "arm64", + "os": "deb", + "name": "Debian / Ubuntu arm64", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh_1.10.6_arm64.deb" + }, + { + "arch": "arm64", + "os": "rpm", + "name": "RHEL / CentOS arm64", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-1.10.6.aarch64.rpm" + }, + { + "arch": "arm64", + "os": "linux", + "name": "Linux Tarball arm64 (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-arm64-openssl11.tgz" + }, + { + "arch": "arm64", + "os": "deb", + "name": "Debian / Ubuntu arm64 (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11_1.10.6_arm64.deb" + }, + { + "arch": "arm64", + "os": "rpm", + "name": "Redhat / Centos arm64 (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11-1.10.6.aarch64.rpm" + }, + { + "arch": "arm64", + "os": "linux", + "name": "Linux Tarball arm64 (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-arm64-openssl3.tgz" + }, + { + "arch": "arm64", + "os": "deb", + "name": "Debian / Ubuntu arm64 (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_1.10.6_amd64.deb" + }, + { + "arch": "arm64", + "os": "rpm", + "name": "RHEL / CentOS arm64 (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3-1.10.6.aarch64.rpm" + }, + { + "arch": "ppc64le", + "os": "linux", + "name": "Linux Tarball ppc64le", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-ppc64le.tgz" + }, + { + "arch": "ppc64le", + "os": "rpm", + "name": "Redhat / Centos ppc64le", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-1.10.6.ppc64le.rpm" + }, + { + "arch": "s390x", + "os": "linux", + "name": "Linux Tarball s390x", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-linux-s390x.tgz" + }, + { + "arch": "s390x", + "os": "rpm", + "name": "Redhat / Centos s390x", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-1.10.6.s390x.rpm" + }, + { + "arch": "x64", + "os": "win32", + "name": "Windows 64-bit (8.1+)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-win32-x64.zip" + }, + { + "arch": "x64", + "os": "win32msi", + "name": "Windows 64-bit (8.1+) (MSI)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-1.10.6-x64.msi" + } + ] + }, + { + "_id": "2.0.0", + "version": "2.0.0", + "platform": [ + { + "arch": "x64", + "os": "darwin", + "name": "MacOS 64-bit (10.14+)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-darwin-x64.zip" + }, + { + "arch": "arm64", + "os": "darwin", + "name": "MacOS M1 (11.0+)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-darwin-arm64.zip" + }, + { + "arch": "x64", + "os": "linux", + "name": "Linux Tarball 64-bit", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-x64.tgz" + }, + { + "arch": "x64", + "os": "deb", + "name": "Debian / Ubuntu 64-bit", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh_2.0.0_amd64.deb" + }, + { + "arch": "x64", + "os": "rpm", + "name": "RHEL / CentOS / Fedora / Suse 64-bit", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-2.0.0.x86_64.rpm" + }, + { + "arch": "x64", + "os": "linux", + "name": "Linux Tarball 64-bit (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-x64-openssl11.tgz" + }, + { + "arch": "x64", + "os": "deb", + "name": "Debian / Ubuntu 64-bit (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11_2.0.0_amd64.deb" + }, + { + "arch": "x64", + "os": "rpm", + "name": "RHEL / CentOS 64-bit (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11-2.0.0.x86_64.rpm" + }, + { + "arch": "x64", + "os": "linux", + "name": "Linux Tarball 64-bit (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-x64-openssl3.tgz" + }, + { + "arch": "x64", + "os": "deb", + "name": "Debian / Ubuntu 64-bit (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_2.0.0_amd64.deb" + }, + { + "arch": "x64", + "os": "rpm", + "name": "RHEL / CentOS 64-bit (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3-2.0.0.x86_64.rpm" + }, + { + "arch": "arm64", + "os": "linux", + "name": "Linux Tarball arm64", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-arm64.tgz" + }, + { + "arch": "arm64", + "os": "deb", + "name": "Debian / Ubuntu arm64", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh_2.0.0_arm64.deb" + }, + { + "arch": "arm64", + "os": "rpm", + "name": "RHEL / CentOS arm64", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-2.0.0.aarch64.rpm" + }, + { + "arch": "arm64", + "os": "linux", + "name": "Linux Tarball arm64 (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-arm64-openssl11.tgz" + }, + { + "arch": "arm64", + "os": "deb", + "name": "Debian / Ubuntu arm64 (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11_2.0.0_arm64.deb" + }, + { + "arch": "arm64", + "os": "rpm", + "name": "Redhat / Centos arm64 (shared OpenSSL 1.1)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl11-2.0.0.aarch64.rpm" + }, + { + "arch": "arm64", + "os": "linux", + "name": "Linux Tarball arm64 (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-arm64-openssl3.tgz" + }, + { + "arch": "arm64", + "os": "deb", + "name": "Debian / Ubuntu arm64 (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3_2.0.0_arm64.deb" + }, + { + "arch": "arm64", + "os": "rpm", + "name": "RHEL / CentOS arm64 (shared OpenSSL 3)", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-shared-openssl3-2.0.0.aarch64.rpm" + }, + { + "arch": "ppc64le", + "os": "linux", + "name": "Linux Tarball ppc64le", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-ppc64le.tgz" + }, + { + "arch": "ppc64le", + "os": "rpm", + "name": "Redhat / Centos ppc64le", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-2.0.0.ppc64le.rpm" + }, + { + "arch": "s390x", + "os": "linux", + "name": "Linux Tarball s390x", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-linux-s390x.tgz" + }, + { + "arch": "s390x", + "os": "rpm", + "name": "Redhat / Centos s390x", + "download_link": "https://downloads.mongodb.com/compass/mongodb-mongosh-2.0.0.s390x.rpm" + }, + { + "arch": "x64", + "os": "win32", + "name": "Windows 64-bit (8.1+)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-win32-x64.zip" + }, + { + "arch": "x64", + "os": "win32msi", + "name": "Windows 64-bit (8.1+) (MSI)", + "download_link": "https://downloads.mongodb.com/compass/mongosh-2.0.0-x64.msi" + } + ] + } + ], + "manual_link": "https://docs.mongodb.org/manual/products/mongosh", + "release_notes_link": "https://github.com/mongodb-js/mongosh/releases/tag/v2.0.0", + "previous_releases_link": "", + "development_releases_link": "", + "supported_browsers_link": "", + "tutorial_link": "test" +} diff --git a/packages/build/src/packaging/package/get-package-file.ts b/packages/build/src/packaging/package/get-package-file.ts index 115fa88b7..eaead1807 100644 --- a/packages/build/src/packaging/package/get-package-file.ts +++ b/packages/build/src/packaging/package/get-package-file.ts @@ -12,23 +12,48 @@ export interface PackageFile { contentType: string; } +type PackageFileExtension = 'dmg' | 'tgz' | 'deb' | 'rpm' | 'zip' | 'msi'; + +export function getFileExtension( + packageVariant: PackageVariant +): PackageFileExtension { + switch (getDistro(packageVariant)) { + case 'linux': + return 'tgz'; + case 'rpm': + return 'rpm'; + case 'deb': + return 'deb'; + case 'darwin': + case 'win32': + return 'zip'; + case 'win32msi': + return 'msi'; + default: + throw new Error(`Unknown build variant: ${packageVariant}`); + } +} + export function getPackageFile( packageVariant: PackageVariant, packageInformation: PackageInformationProvider ): PackageFile { const { version, name, debName, rpmName } = packageInformation(packageVariant).metadata; + + const fileExtension = getFileExtension(packageVariant); + switch (getDistro(packageVariant)) { case 'linux': return { - path: `${name}-${version}-${packageVariant}.tgz`, + path: `${name}-${version}-${packageVariant}.${fileExtension}`, contentType: 'application/gzip', }; case 'rpm': return { path: `${rpmName}-${version}.${getRPMArchName( getArch(packageVariant) - )}.rpm`, + )}.${fileExtension}`, contentType: 'application/x-rpm', }; case 'deb': @@ -38,18 +63,18 @@ export function getPackageFile( return { path: `${debName}_${version}_${getDebArchName( getArch(packageVariant) - )}.deb`, + )}.${fileExtension}`, contentType: 'application/vnd.debian.binary-package', }; case 'darwin': case 'win32': return { - path: `${name}-${version}-${packageVariant}.zip`, + path: `${name}-${version}-${packageVariant}.${fileExtension}`, contentType: 'application/zip', }; case 'win32msi': return { - path: `${name}-${version}-${getArch(packageVariant)}.msi`, + path: `${name}-${version}-${getArch(packageVariant)}.${fileExtension}`, contentType: 'application/x-msi', }; default: