mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-08-06 07:13:57 +08:00
chore(release): prepare v5.2.0 stable release
1. update debian changelog version from 5.2.0~alpha1 to 5.2.0 2. remove deprecated CI workflow backup files 3. fix duplicate loading issue by adding loadingTabs state 4. add effectiveLoading computed state to handle per-tab loading status
This commit is contained in:
@@ -1,143 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags:
|
||||
- "*"
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**.spec.js"
|
||||
- ".idea"
|
||||
- ".vscode"
|
||||
- ".dockerignore"
|
||||
- "Dockerfile"
|
||||
- ".gitignore"
|
||||
- ".github/**"
|
||||
- "!.github/workflows/build.yml"
|
||||
- "!.github/workflows/test.yml"
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "**.spec.js"
|
||||
- ".idea"
|
||||
- ".vscode"
|
||||
- ".dockerignore"
|
||||
- "Dockerfile"
|
||||
- ".gitignore"
|
||||
- ".github/**"
|
||||
- "!.github/workflows/build.yml"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run tests
|
||||
run: npm run test
|
||||
|
||||
- name: Run lint
|
||||
run: npm run lint
|
||||
|
||||
build:
|
||||
needs: test
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: ${{ matrix.docker_image }}
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
package: [deb, rpm]
|
||||
architecture: [x64, arm64]
|
||||
include:
|
||||
- package: deb
|
||||
docker_image: "debian:12"
|
||||
- package: rpm
|
||||
docker_image: "almalinux:8"
|
||||
|
||||
steps:
|
||||
- name: Install Build Dependencies
|
||||
if: matrix.package == 'deb'
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y curl git wget devscripts fakeroot equivs lintian python3
|
||||
apt-get install -y build-essential
|
||||
|
||||
- name: Install Build Dependencies
|
||||
if: matrix.package == 'rpm'
|
||||
run: |
|
||||
dnf install -y curl git wget rpm-build rpmdevtools rpmlint python3
|
||||
dnf group install -y "Development Tools"
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
npm install
|
||||
|
||||
- name: Download host-spawn
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ matrix.architecture }}" == "x64" ]; then
|
||||
curl -fsSL -o ./extras/host-spawn https://github.com/1player/host-spawn/releases/latest/download/host-spawn-x86_64
|
||||
elif [ "${{ matrix.architecture }}" == "arm64" ]; then
|
||||
curl -fsSL -o ./extras/host-spawn https://github.com/1player/host-spawn/releases/latest/download/host-spawn-aarch64
|
||||
fi
|
||||
chmod +x ./extras/host-spawn
|
||||
|
||||
- name: Build Release Files
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ matrix.package }}" == "deb" ]; then
|
||||
npm run build:deb -- --${{ matrix.architecture }}
|
||||
elif [ "${{ matrix.package }}" == "rpm" ]; then
|
||||
npm run build:rpm -- --${{ matrix.architecture }}
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: release_for_${{ matrix.package }}_${{ matrix.architecture }}
|
||||
path: release/**/*.${{ matrix.package }}
|
||||
retention-days: 5
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Upload to GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.ref_name }}
|
||||
files: |
|
||||
artifacts/**/*.deb
|
||||
artifacts/**/*.rpm
|
||||
generate_release_notes: true
|
||||
@@ -1,83 +0,0 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm run test -- --coverage
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: ./coverage/lcov.info
|
||||
flags: unittests
|
||||
name: codecov-umbrella
|
||||
|
||||
e2e-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps chromium
|
||||
|
||||
- name: Run E2E tests
|
||||
run: xvfb-run npm run test:e2e
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run ESLint
|
||||
run: npm run lint
|
||||
|
||||
- name: Check formatting
|
||||
run: npm run format -- --check
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
spark-store (5.2.0~alpha1) UNRELEASED; urgency=medium
|
||||
spark-store (5.2.0) UNRELEASED; urgency=medium
|
||||
|
||||
* Initial release. (Closes: #nnnn) <nnnn is the bug number of your ITP>
|
||||
|
||||
|
||||
+35
-1
@@ -101,7 +101,7 @@
|
||||
<template v-else>
|
||||
<AppGrid
|
||||
:apps="filteredApps"
|
||||
:loading="loading"
|
||||
:loading="effectiveLoading"
|
||||
:scroll-key="activeTab + '-' + selectedCategory"
|
||||
:store-filter="storeFilter"
|
||||
:show-origin="storeFilter === 'both' && !isHomeListTab"
|
||||
@@ -449,6 +449,8 @@ const tabCategories: Ref<Record<string, Record<string, CategoryInfo>>> = ref(
|
||||
{},
|
||||
);
|
||||
const tabApps: Ref<Record<string, App[]>> = ref({});
|
||||
// 正在加载中的入口 ID 集合,用于显示骨架屏并防止重复加载
|
||||
const loadingTabs = ref<Set<string>>(new Set());
|
||||
// 首页推荐列表入口对应的各来源 jsonUrl:{ [entryId]: { spark?, apm? } }
|
||||
const homeListUrls = ref<Record<string, { spark?: string; apm?: string }>>({});
|
||||
const activeTab = ref("home");
|
||||
@@ -568,6 +570,16 @@ const displayApps = computed(() => {
|
||||
return tabApps.value[activeTab.value] || [];
|
||||
});
|
||||
|
||||
// 当前的加载状态:全局加载中,或当前入口正在加载中
|
||||
const effectiveLoading = computed(
|
||||
() =>
|
||||
loading.value ||
|
||||
(activeTab.value !== "home" &&
|
||||
activeTab.value !== "all" &&
|
||||
loadingTabs.value.has(activeTab.value) &&
|
||||
!tabApps.value[activeTab.value]),
|
||||
);
|
||||
|
||||
const filteredApps = computed(() => {
|
||||
let result = [...displayApps.value];
|
||||
|
||||
@@ -1183,10 +1195,15 @@ const loadHomeListEntries = async () => {
|
||||
// 加载首页推荐列表的应用数据(复用首页逻辑,合并展示 spark+apm)
|
||||
const loadHomeListApps = async (entryId: string) => {
|
||||
if (tabApps.value[entryId]) return;
|
||||
// 防止重复加载:如果正在加载中则跳过
|
||||
if (loadingTabs.value.has(entryId)) return;
|
||||
|
||||
const urls = homeListUrls.value[entryId];
|
||||
if (!urls) return;
|
||||
|
||||
// 标记为加载中
|
||||
loadingTabs.value = new Set(loadingTabs.value).add(entryId);
|
||||
|
||||
const arch = window.apm_store.arch || "amd64";
|
||||
const loadedApps: App[] = [];
|
||||
|
||||
@@ -1246,6 +1263,12 @@ const loadHomeListApps = async (entryId: string) => {
|
||||
);
|
||||
|
||||
tabApps.value = { ...tabApps.value, [entryId]: loadedApps };
|
||||
|
||||
// 移除加载标记
|
||||
const next = new Set(loadingTabs.value);
|
||||
next.delete(entryId);
|
||||
loadingTabs.value = next;
|
||||
|
||||
logger.info(`首页列表 "${entryId}" 加载完成,共 ${loadedApps.length} 个应用`);
|
||||
};
|
||||
|
||||
@@ -2576,10 +2599,15 @@ const loadTabCategories = async () => {
|
||||
|
||||
const loadTabApps = async (entryId: string) => {
|
||||
if (tabApps.value[entryId]) return;
|
||||
// 防止重复加载:如果正在加载中则跳过
|
||||
if (loadingTabs.value.has(entryId)) return;
|
||||
|
||||
const entry = sidebarEntries.value.find((e) => e.id === entryId);
|
||||
if (!entry || entry.type !== "category") return;
|
||||
|
||||
// 标记为加载中
|
||||
loadingTabs.value = new Set(loadingTabs.value).add(entryId);
|
||||
|
||||
const arch = window.apm_store.arch || "amd64";
|
||||
const modes: Array<"spark" | "apm"> =
|
||||
storeFilter.value === "both" ? ["spark", "apm"] : [storeFilter.value];
|
||||
@@ -2640,6 +2668,12 @@ const loadTabApps = async (entryId: string) => {
|
||||
const loadedApps = results.flat();
|
||||
|
||||
tabApps.value = { ...tabApps.value, [entryId]: loadedApps };
|
||||
|
||||
// 移除加载标记
|
||||
const next = new Set(loadingTabs.value);
|
||||
next.delete(entryId);
|
||||
loadingTabs.value = next;
|
||||
|
||||
logger.info(`入口 "${entryId}" 加载完成,共 ${loadedApps.length} 个应用`);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user