Skip to content

Commit 1db53da

Browse files
authored
Merge pull request #10648 from Chasen-Zhang/main
fix(replaced): x86_64-unknown-linux-musl => x86_64-unknown-linux-gnu
2 parents 3b44e83 + 857318a commit 1db53da

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

website/src/hooks/useGetReleases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function numberFormat(num: number): string | number {
66
}
77
const useGetReleases = () => {
88
const { releasesList, repoResource, stargazersCount } = usePluginData('fetch-databend-releases') as IGlobalData;
9-
let tagName = releasesList[0]?.tag_name??'v1.0.22-nightly';
9+
const tagName = releasesList[0]?.tag_name??'v1.0.22-nightly';
1010
const formatStargazersCount = numberFormat(stargazersCount);
1111
return {
1212
releasesList,

website/src/pages/download/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2023 Datafuse Labs.
2-
import React, { FC, ReactElement, ReactNode } from 'react';
2+
import React, { FC, ReactElement } from 'react';
33
import Layout from '@theme/Layout';
44
import clsx from 'clsx';
55
import ReactMarkdown from 'react-markdown';
@@ -55,7 +55,7 @@ const Releases: FC = (): ReactElement => {
5555
href={browser_download_url}
5656
isDownload
5757
key={index}
58-
className={clsx(styles.nowItem, !isApple && styles.nowItemApple)}
58+
className={clsx(styles.nowItem, !isApple && styles.nowItemLinux)}
5959
padding={[8, 16]}>
6060
<Icons isApple={isApple}></Icons>
6161
<div className={styles.right}>

website/src/pages/download/styles.module.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@
4646
margin-bottom: 12px;
4747
color: var(--color-text-0);
4848
}
49+
ul {
50+
padding-left: 24px;
51+
}
4952
li {
5053
line-height: 28px;
54+
list-style: disc;
5155
}
5256
a {
5357
text-decoration: underline;
@@ -76,7 +80,7 @@
7680
}
7781
}
7882
}
79-
&.nowItemApple {
83+
&.nowItemLinux {
8084
background-color: var(--indigo-5);
8185
}
8286
}

website/src/plugins/fetch-databend-releases.js

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
const axios = require('axios');
22
const bytes = require('bytes');
33
// Define constant
4-
const LINUX_GENERIC_X86 = 'Linux Generic(x86, 64-bit)';
5-
const LINUX_GENERIC_ARM = 'Linux Generic(ARM, 64-bit)';
6-
const MAC_X86 = 'macOS (x86, 64-bit)';
7-
const MAC_ARM = 'macOS (ARM, 64-bit)';
4+
const LINUX_GENERIC_X86 = 'Linux Generic (x86, 64-bit)';
5+
const LINUX_GENERIC_ARM = 'Linux Generic (ARM, 64-bit)';
6+
const MAC_X86 = 'Mac Intel Chip (x86, 64-bit)';
7+
const MAC_ARM = 'Mac Apple Chip (ARM, 64-bit)';
88
const GITHUB_DOWNLOAD = 'https://github.com/datafuselabs/databend/releases/download';
99
const GITHUB_REPO = 'https://api.github.com/repos/datafuselabs/databend';
1010
const DATABEND_RELEASES = 'https://repo.databend.rs/databend/releases.json';
@@ -22,15 +22,15 @@ module.exports = function fetchDatabendReleasesPlugin() {
2222
const { data: releasesList } = await axios.get(DATABEND_RELEASES);
2323
const { data: repoResource } = await axios.get(GITHUB_REPO);
2424
// Preprocessing data, Just part of it
25-
let releases = releasesList?.filter(release=> release.assets?.length).slice(0, 21);
25+
const releases = releasesList?.filter(release=> release.assets?.length).slice(0, 21);
2626
const processedData = releases.map(release=> {
27-
let afterFilterAssets =
28-
release.assets
29-
.filter(asset => !/linux-gnu|testsuites|sha256sums|\.deb/.test(asset.name))
27+
const filterAssets = namesToMatch(release);
28+
const afterProcessedAssets =
29+
filterAssets
3030
.map(asset => {
31-
let isApple = asset.name.includes('apple');
32-
let isAarch64 = asset.name.includes('aarch64');
33-
let osTypeDesc = isApple
31+
const isApple = asset.name.includes('apple');
32+
const isAarch64 = asset.name.includes('aarch64');
33+
const osTypeDesc = isApple
3434
? (isAarch64 ? MAC_ARM : MAC_X86)
3535
: (isAarch64 ? LINUX_GENERIC_ARM : LINUX_GENERIC_X86);
3636
return {
@@ -54,13 +54,27 @@ module.exports = function fetchDatabendReleasesPlugin() {
5454
return {
5555
...release,
5656
originAssets: release.assets,
57-
assets: afterFilterAssets,
57+
assets: afterProcessedAssets,
5858
filterBody: release.body
5959
.replace(IGNORE_TEXT, '')
6060
.replace(REG, REPLACE_TEXT)
6161
.replace(/@(\w+)/g, '**@$1**')
6262
}
6363
});
64+
// name match list
65+
function namesToMatch(release) {
66+
const { assets, tag_name } = release;
67+
const namesDisplayList = [
68+
`databend-${tag_name}-aarch64-apple-darwin.tar.gz`,
69+
`databend-${tag_name}-x86_64-apple-darwin.tar.gz`,
70+
`databend-${tag_name}-aarch64-unknown-linux-musl.tar.gz`,
71+
`databend-${tag_name}-x86_64-unknown-linux-gnu.tar.gz`
72+
];
73+
const filteredAssets = assets?.filter(item => {
74+
return namesDisplayList?.includes(item?.name);
75+
});
76+
return filteredAssets;
77+
}
6478
// Set global data
6579
setGlobalData({releasesList: processedData, repoResource, stargazersCount: repoResource.stargazers_count});
6680
},

0 commit comments

Comments
 (0)