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 0fa3419aa..852318375 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', 'debian92', 'debian10', 'debian11', 'debian12'] const allLinux = [...rhel70AndAboveAndRpmBased, ...ubuntu1804AndAboveAndDebBased] +const publicDescriptions = { + darwin_x64: 'MacOS x64 (10.14+)', + darwin_arm64: 'MacOS M1 (11.0+)', + linux_x64: 'Linux x64', + linux_arm64: 'Linux arm64', + debian_x64: 'Debian (10+) / Ubuntu (18.04+) x64', + debian_arm64: 'Debian (10+) / Ubuntu (18.04+) arm64', + rhel_x64: 'RHEL / CentOS (7+) x64', + rhel_arm64: 'RHEL / CentOS (7+) arm64', + linux_ppc64le: 'Linux ppc64le', + rhel_ppc64le: 'RHEL / CentOS (7+) ppc64le', + linux_s390x: 'Linux ppc64le', + rhel_s390x: 'RHEL / CentOS (7+) ppc64le', + win32_x64: 'Windows x64 (8.1+)' +}; + 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', 'debian9-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', 'amazonlinux1-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', 'debian9-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', 'amazonlinux1-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 c9a8a07f8..919ce73bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9494,16 +9494,13 @@ } }, "node_modules/@mongodb-js/dl-center": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.0.1.tgz", - "integrity": "sha512-gUxfbhvYWjWK+QHyrB2iiwkN/EZqab6tJG33A7rNR5lPC9rmzzBAKU62AuB4vFhaMtT3m9Vswbu2040IqMm0xw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.1.1.tgz", + "integrity": "sha512-1cqBYtfMdoOtW3D8MNknhbub1Z7SI/31zPRlHMxmFuwjEittESlBBCa/20OVi6QdjxHgi2hE1j9sJqKHM/fkBA==", "dependencies": { "ajv": "^6.12.5", - "aws-sdk": "^2.770.0", - "node-fetch": "^2.6.1" - }, - "engines": { - "node": ">= 12" + "aws-sdk": "^2.1441.0", + "node-fetch": "^2.6.7" } }, "node_modules/@mongodb-js/eslint-config-devtools": { @@ -12853,9 +12850,9 @@ } }, "node_modules/aws-sdk": { - "version": "2.1354.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz", - "integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==", + "version": "2.1442.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1442.0.tgz", + "integrity": "sha512-Rp6kP813tdlg3R3Zi6Olt5NSutlx1UjhhoogJpEeIUQFXul7t/mu5FpyUZmYRsBN6TPCj9QD0eJOtBaFN4LZtg==", "dependencies": { "buffer": "4.9.2", "events": "1.1.1", @@ -30226,7 +30223,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", @@ -38965,13 +38962,13 @@ "integrity": "sha512-rBwJHZ0g3Ma6zluNUWfeFXvuxsz9ZtFX2YZ1qR/aQEwk64ZhOqjrVbcROSdtfGUs4qg1JGXFIU+ZQ+oLYqPEvQ==" }, "@mongodb-js/dl-center": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.0.1.tgz", - "integrity": "sha512-gUxfbhvYWjWK+QHyrB2iiwkN/EZqab6tJG33A7rNR5lPC9rmzzBAKU62AuB4vFhaMtT3m9Vswbu2040IqMm0xw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@mongodb-js/dl-center/-/dl-center-1.1.1.tgz", + "integrity": "sha512-1cqBYtfMdoOtW3D8MNknhbub1Z7SI/31zPRlHMxmFuwjEittESlBBCa/20OVi6QdjxHgi2hE1j9sJqKHM/fkBA==", "requires": { "ajv": "^6.12.5", - "aws-sdk": "^2.770.0", - "node-fetch": "^2.6.1" + "aws-sdk": "^2.1441.0", + "node-fetch": "^2.6.7" } }, "@mongodb-js/eslint-config-devtools": { @@ -39494,7 +39491,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/prettier-config-devtools": "^1.0.1", @@ -42471,9 +42468,9 @@ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "aws-sdk": { - "version": "2.1354.0", - "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1354.0.tgz", - "integrity": "sha512-3aDxvyuOqMB9DqJguCq6p8momdsz0JR1axwkWOOCzHA7a35+Bw+WLmqt3pWwRjR1tGIwkkZ2CvGJObYHsOuw3w==", + "version": "2.1442.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1442.0.tgz", + "integrity": "sha512-Rp6kP813tdlg3R3Zi6Olt5NSutlx1UjhhoogJpEeIUQFXul7t/mu5FpyUZmYRsBN6TPCj9QD0eJOtBaFN4LZtg==", "requires": { "buffer": "4.9.2", "events": "1.1.1", diff --git a/packages/build/package.json b/packages/build/package.json index dd7ea48c0..939800d00 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -59,7 +59,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.0.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 0daa70b0c..b68ef41e2 100644 --- a/packages/build/src/download-center/config.spec.ts +++ b/packages/build/src/download-center/config.spec.ts @@ -1,4 +1,7 @@ -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 type { PackageInformationProvider } from '../packaging'; import { expect } from 'chai'; import sinon from 'sinon'; @@ -40,25 +43,27 @@ describe('DownloadCenter config', function () { expect(version.version).to.equal('1.2.2'); }); - it('has an artifact for darwin', function () { + it('has an artifact for MacOS x64 (10.14+)', 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 (10.14+)' ); - 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', @@ -67,23 +72,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 (8.1+)' ); - 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', @@ -93,10 +101,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', diff --git a/packages/build/src/download-center/config.ts b/packages/build/src/download-center/config.ts index 4c3414bc1..de3162521 100644 --- a/packages/build/src/download-center/config.ts +++ b/packages/build/src/download-center/config.ts @@ -3,7 +3,10 @@ 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, @@ -19,6 +22,7 @@ import { getDistro, getServerLikeArchName, getServerLikeTargetList, + getDownloadCenterPackageType, } from '../config'; import type { PackageInformationProvider } from '../packaging'; import { getPackageFile } from '../packaging'; @@ -166,18 +170,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/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: