From 6d2d7bd475af48cb474593a1b7f49109d7744d89 Mon Sep 17 00:00:00 2001 From: Soltus Date: Wed, 24 Jul 2024 17:57:04 +0800 Subject: [PATCH] =?UTF-8?q?docker=20hub=20=E4=BD=BF=E7=94=A8=E5=8F=91?= =?UTF-8?q?=E8=A1=8C=E6=B8=A0=E9=81=93=20#851?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- .github/workflows/dockerimage.yml | 82 ++++++++++- app/package.json | 10 +- docs/starlight/astro.config.mjs | 4 + .../src/components/BannerTopArchived.astro | 12 ++ .../src/components/BannerTopPrLock.astro | 12 ++ .../src/components/BannerTopPrNeed.astro | 12 ++ .../src/components/GithubLabels.astro | 6 - .../Chromium/94to114.mdx" | 6 +- .../channels.mdx" | 129 ++++++++++++++++++ ...3\351\200\237\345\274\200\345\247\213.mdx" | 14 ++ docs/starlight/src/styles/banner_top.css | 88 ++++++++++++ package.json | 12 +- 13 files changed, 365 insertions(+), 24 deletions(-) create mode 100644 docs/starlight/src/components/BannerTopArchived.astro create mode 100644 docs/starlight/src/components/BannerTopPrLock.astro create mode 100644 docs/starlight/src/components/BannerTopPrNeed.astro delete mode 100644 docs/starlight/src/components/GithubLabels.astro rename "docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.md" => "docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.mdx" (94%) create mode 100644 "docs/starlight/src/content/docs/\345\217\221\350\241\214\350\257\264\346\230\216/channels.mdx" create mode 100644 docs/starlight/src/styles/banner_top.css diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index abdd3f15db..4a7c330670 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -11,7 +11,7 @@ env: repo_name_android: "Sillot-android" repo_name: "Sillot" repo_owner: "Hi-Windom" - package_json: "app/package.json" + package_json: "package.json" pnpm_ws: "pnpm-workspace.yaml" android_gradle_build_output: "build/outputs/apk/action" android_gradle_build_params: "assembleAction -profile --quiet --stacktrace" diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index bd704e44d6..72b1483025 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -7,23 +7,56 @@ on: description: '镜像标签,留空则使用 package.json 中的版本号。务必注意:请确认选择了正确的分支。完整输入示例:0.31.1000-rc0 ' required: true default: '' - push: - branches: - - master + channel: + description: "发行渠道" + required: true + type: choice + options: + - T + - R & Rococo & latest + - P & Pioneer + - D & Dev + - C & Canary + - E & Emo + - G & Gibbet + - S & Salvation # ref https://docs.github.com/zh/actions/learn-github-actions/variables env: repo_name_android: "Sillot-android" repo_name: "Sillot" repo_owner: "Hi-Windom" - package_json: "app/package.json" + package_json: "package.json" docker_hub_readme: "./.github/docs/docker/README.md" docker_hub_owner: "soltus" docker_hub_repo: "sillot" jobs: + setup: + runs-on: ubuntu-latest + outputs: + docker_file: ${{ steps.set-vars.outputs.docker_file }} + steps: + - name: Set variables based on input name + id: set-vars + run: | + # 定义映射关系 + declare -A dockerFileMap=( + ["T"]="Dockerfile" + ["R & Rococo & latest"]="Dockerfile" + ["P & Pioneer"]="Dockerfile" + ["D & Dev"]="Dockerfile" + ["C & Canary"]="Dockerfile" + ["E & Emo"]="Dockerfile" + ["G & Gibbet"]="Dockerfile" + ["S & Salvation"]="Dockerfile" + ) + channel="${{ github.event.inputs.channel }}" + docker_file="${dockerFileMap[$channel]}" + echo "docker_file=$docker_file" >>$GITHUB_OUTPUT build: name: Release Docker Image + needs: [setup] runs-on: ubuntu-latest permissions: packages: write @@ -58,6 +91,7 @@ jobs: docker-images: true swap-storage: true + # 设置 up QEMU 用于多架构构建 - name: 🔨 Set up QEMU uses: docker/setup-qemu-action@v3 @@ -73,11 +107,47 @@ jobs: - name: 🔥 Build the Docker image use Workflow Dispatch inputs' version if: ${{ github.event_name == 'workflow_dispatch' && !github.event.inputs.image_tag == '' }} run: | - docker buildx build --push --platform linux/amd64 -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:latest -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:${{ github.event.inputs.image_tag }}-sillot . + # Check if the channel input contains '&', if not, it's a single tag + if [[ "${{ github.event.inputs.channel }}" == *" & "* ]]; then + # Split the channel input by ' & ' to get an array of tags + IFS=' & ' read -ra TAGS <<< "${{ github.event.inputs.channel }}" + else + # Use the channel input as a single tag + TAGS=("${{ github.event.inputs.channel }}") + fi + # Construct the -t options for the docker buildx command + TAG_ARGS=() + for TAG in "${TAGS[@]}"; do + TAG_ARGS+=("-t" "${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:$TAG") + TAG_ARGS+=("-t" "${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:$TAG-${{ github.event.inputs.image_tag }}") + done + # Run the docker buildx command once with all the -t options + docker buildx build --push --platform linux/amd64 \ + --file ${{ needs.setup.outputs.docker_file }} \ + "${TAG_ARGS[@]}" \ + . - name: 🔥 Build the Docker image use package_json version if: ${{ github.event_name == 'push' || github.event.inputs.image_tag == '' }} run: | - docker buildx build --push --platform linux/amd64 -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:latest -t ${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:${{ steps.version.outputs.value }}-sillot . + # Check if the channel input contains '&', if not, it's a single tag + if [[ "${{ github.event.inputs.channel }}" == *" & "* ]]; then + # Split the channel input by ' & ' to get an array of tags + IFS=' & ' read -ra TAGS <<< "${{ github.event.inputs.channel }}" + else + # Use the channel input as a single tag + TAGS=("${{ github.event.inputs.channel }}") + fi + # Construct the -t options for the docker buildx command + TAG_ARGS=() + for TAG in "${TAGS[@]}"; do + TAG_ARGS+=("-t" "${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:$TAG") + TAG_ARGS+=("-t" "${{ env.docker_hub_owner }}/${{ env.docker_hub_repo }}:$TAG-${{ steps.version.outputs.value }}") + done + # Run the docker buildx command once with all the -t options + docker buildx build --push --platform linux/amd64 \ + --file ${{ needs.setup.outputs.docker_file }} \ + "${TAG_ARGS[@]}" \ + . - name: 📤 Update Docker Hub Description uses: peter-evans/dockerhub-description@v4 diff --git a/app/package.json b/app/package.json index 1c990e81f6..e2509e1c37 100644 --- a/app/package.json +++ b/app/package.json @@ -1,8 +1,6 @@ { - "name": "sillot", + "name": "sillot-gibbet", "version": "0.35.24072117", - "syv": "3.1.2", - "sypv": "[3.0.16, 3.0.17, 3.1.0, 3.1.1]", "description": "Build Your Eternal Digital Garden", "homepage": "https://sillot.db.sc.cn", "repository": "https://github.com/Hi-Windom/Sillot", @@ -12,7 +10,6 @@ "pnpm": ">=9.1.0" }, "packageManager": "pnpm@9.5.0", - "actionInstallCommand": "pnpm install --no-frozen-lockfile", "scripts": { "test": "echo 'Test your sister day by day'", "sp": "pnpm store prune", @@ -161,8 +158,5 @@ "electron-store": "^10.0.0", "monaco-editor": "^0.50.0", "monaco-editor-nls": "^3.1.0" - }, - "resolutions": { - "lodash": "4.17.21" } -} \ No newline at end of file +} diff --git a/docs/starlight/astro.config.mjs b/docs/starlight/astro.config.mjs index fa382d80ae..5efff74b7e 100644 --- a/docs/starlight/astro.config.mjs +++ b/docs/starlight/astro.config.mjs @@ -57,6 +57,10 @@ export default defineConfig({ label: "汐洛宝典", autogenerate: { directory: "汐洛宝典" }, }, + { + label: "发行说明", + autogenerate: { directory: "发行说明" }, + }, { label: "依赖更新", autogenerate: { directory: "依赖更新" }, diff --git a/docs/starlight/src/components/BannerTopArchived.astro b/docs/starlight/src/components/BannerTopArchived.astro new file mode 100644 index 0000000000..ec78e842f7 --- /dev/null +++ b/docs/starlight/src/components/BannerTopArchived.astro @@ -0,0 +1,12 @@ +--- +import "../styles/banner_top.css"; +import { Icon } from '@astrojs/starlight/components'; +--- + +
+ +
diff --git a/docs/starlight/src/components/BannerTopPrLock.astro b/docs/starlight/src/components/BannerTopPrLock.astro new file mode 100644 index 0000000000..8805f4cf53 --- /dev/null +++ b/docs/starlight/src/components/BannerTopPrLock.astro @@ -0,0 +1,12 @@ +--- +import "../styles/banner_top.css"; +import { Icon } from '@astrojs/starlight/components'; +--- + +
+ +
diff --git a/docs/starlight/src/components/BannerTopPrNeed.astro b/docs/starlight/src/components/BannerTopPrNeed.astro new file mode 100644 index 0000000000..11b86728ff --- /dev/null +++ b/docs/starlight/src/components/BannerTopPrNeed.astro @@ -0,0 +1,12 @@ +--- +import "../styles/banner_top.css"; +import { Icon } from '@astrojs/starlight/components'; +--- + +
+ +
diff --git a/docs/starlight/src/components/GithubLabels.astro b/docs/starlight/src/components/GithubLabels.astro deleted file mode 100644 index b3cf6a9e99..0000000000 --- a/docs/starlight/src/components/GithubLabels.astro +++ /dev/null @@ -1,6 +0,0 @@ ---- -import "/src/styles/github_labels.scss"; -import { Badge } from '@astrojs/starlight/components'; ---- - - diff --git "a/docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.md" "b/docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.mdx" similarity index 94% rename from "docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.md" rename to "docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.mdx" index 3c53e8466e..8726748a25 100644 --- "a/docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.md" +++ "b/docs/starlight/src/content/docs/\344\276\235\350\265\226\346\233\264\346\226\260/Chromium/94to114.mdx" @@ -2,6 +2,10 @@ title: 94to114 --- +import BannerTopArchived from '@components/BannerTopArchived.astro'; + + + Chromium 94 功能冻结于2021年7月29日,已经不满足新彖乄要求。 2024年7月15日,汐洛彖夲肜矩阵v0.35将要求提升至 114(2023年4月11日功能冻结)。 @@ -22,7 +26,7 @@ Chromium 94 功能冻结于2021年7月29日,已经不满足新彖乄要求。 > 由不支持变更为完全支持( 104 开始) 语法改进,使使用具有“范围”类型(如宽度或高度)的功能的媒体查询不那么冗长。可以与普通的数学比较运算符一起使用。 -例如: @media (100px <= width <= 1900px) 等价于 @media (min-width: 100px) and (max-width: 1900px) +例如: @media (100px \<= width \<= 1900px) 等价于 @media (min-width: 100px) and (max-width: 1900px) ### LCH 和 Lab 颜色值 | LCH and Lab color values diff --git "a/docs/starlight/src/content/docs/\345\217\221\350\241\214\350\257\264\346\230\216/channels.mdx" "b/docs/starlight/src/content/docs/\345\217\221\350\241\214\350\257\264\346\230\216/channels.mdx" new file mode 100644 index 0000000000..ad78bb94f7 --- /dev/null +++ "b/docs/starlight/src/content/docs/\345\217\221\350\241\214\350\257\264\346\230\216/channels.mdx" @@ -0,0 +1,129 @@ +--- +title: 发行渠道 +sidebar: +# 为链接设置自定义顺序,数字越小显示在上方(全局的,这将影响父层级排序) + order: 0 + # 为链接添加徽章 + badge: + text: 必读 + variant: tip +--- + +import { Aside } from '@astrojs/starlight/components'; +import { Card, CardGrid } from '@astrojs/starlight/components'; +import BannerTopPrLock from '@components/BannerTopPrLock.astro'; + + + + + +渠道制将是汐洛宝典的默认发行方式,渠道将决定用户可以使用的特性,以及特性更新的周期。docker hub 率先支持, github 将在后续支持(部分渠道工作流将转移至下游)。 + + + +## 新彖乄渠道 + +> 新彖乄渠道是海文东标准的一部分 + + +【汐洛】全矩阵经过周期观察验证后才会推送新彖乄渠道更新,仅包含已冻结的特性,由洛可可渠道裁剪未冻结的特性后传递,适合新彖乄用户。 + +在 docker hub ,新彖乄渠道使用 `T` 标签。 + +版本号更新 0.100.*-T -> 0.200.*-T ,重大修复版本可例外,更新周期很长(6月左右) + + +## 洛可可渠道 + +> 洛可可渠道是海文东标准的一部分 + + + 【汐洛·洛可可】洛可可渠道包括已冻结的特性和已稳定的未冻结特性,由先锋渠道禁用实验性特性后传递,适合大多数用户。 + + 在 docker hub ,洛可可渠道使用 `Rococo` 和 `R` 标签,额外使用 `latest` 这一标签。 + + 功能版本号更新 0.110.* -> 0.120.* ,重大修复版本可例外,更新周期较长(31天左右) + + + +## 先锋渠道 + +> 先锋渠道是海文东标准的一部分 + + + 【汐洛·先锋】先锋渠道,包括实验性特性,由开发者渠道裁剪开发测试套件等后传递,适合喜欢探索尝鲜的用户。 + + 在 docker hub,先锋渠道使用 `Pioneer` 和 `P` 标签。 + + 功能版本号更新 0.100.* -> 0.101.* ,重大修复版本可例外,更新周期较短(13天左右) + + +## 开发者渠道 + +> 开发者渠道是海文东标准的一部分 + + + 【汐洛·开发者】开发者渠道,包括实验性特性,且包括开发测试套件等,由金丝雀渠道优化后传递,面向所有开发者。 + + 在 docker hub,开发者渠道使用 `Dev` 和 `D` 标签。 + + 版本号更新 0.100.* -> 0.100.* ,更新周期较短(5天左右) + + +## 金丝雀渠道 + +> 金丝雀渠道是海文东标准的一部分 + + + 【汐洛·金丝雀】金丝雀渠道,包含了垃圾代码,面向内部开发者。 + + 在 docker hub,金丝雀渠道使用 `Canary` 和 `C` 标签。 + + 版本号更新 0.100.* -> 0.100.* ,无更新周期。 + + +## 神罚渠道 + +> 神罚渠道是海文东标准的一部分 + + + 【汐洛·神罚】神罚渠道,通常用于情绪测试,基本上可以确定是有问题的,因此仅面向神,正常人请勿使用。 + + 在 docker hub ,神罚渠道使用 `Emo` 和 `E` 标签。 + + 版本号更新 0.100.*-E1 -> 0.100.*-E2 ,无更新周期。 + + +## 其他渠道 + + + 【汐洛·绞架】绞架渠道,仅包括汐洛绞架,更新周期很长,适合喜欢小而美的用户。 + + 版本号更新与可可渠道一致。 + + + 【汐洛·救赎】救赎渠道,移除了汐洛绞架,更新周期很长,适合喜欢小而美的用户。 + + 版本号更新与可可渠道一致。 + + + +## 渠道在汐洛的基本实现 + +> TODO + +### 业务拆分 + +### 特性的冻结 + +### 实验性特性 + +### 独立发行说明 + +### 版本号判断 + +…… diff --git "a/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.mdx" "b/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.mdx" index 398c23c007..07c66e0de1 100644 --- "a/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.mdx" +++ "b/docs/starlight/src/content/docs/\346\261\220\346\264\233\345\256\235\345\205\270/\345\277\253\351\200\237\345\274\200\345\247\213.mdx" @@ -1,5 +1,12 @@ --- title: 快速开始 +sidebar: +# 为链接设置自定义顺序,数字越小显示在上方(全局的,这将影响父层级排序) + order: 0 + # 为链接添加徽章 + badge: + text: 必读 + variant: tip --- import { sillotNoteName_yobeCe, @@ -26,6 +33,7 @@ import { lnco_doCe } from '../../../Const' import { Steps } from '@astrojs/starlight/components'; +import { Aside } from '@astrojs/starlight/components'; ## 🦢 {sillot_yobeCe}缘起 @@ -98,3 +106,9 @@ import { Steps } from '@astrojs/starlight/components'; {sillotMatrixName_yobeCe}没有收费计划,但这不意味着用户可以免费使用{sillotMatrixName_yobeCe}的全部功能,因为有些收费特性来自供应链上游(例如思源笔记)或者授权认证服务。{sillotMatrixName_yobeCe}尊重开源生态与他人劳动成果,不会对集成的开源功能私自收费,也不会破解供应链上游提供的付费功能给用户(但保留开发者内部测试时暂时破解的权利)。 ## 🙋 {sillotMatrixName_yobeCe}的版本划分与更新节奏是? + +见发行说明。 + + diff --git a/docs/starlight/src/styles/banner_top.css b/docs/starlight/src/styles/banner_top.css new file mode 100644 index 0000000000..3f42cf655b --- /dev/null +++ b/docs/starlight/src/styles/banner_top.css @@ -0,0 +1,88 @@ +.flash-full:not(.Banner) { + border-radius: 0; + border-width: var(--borderWidth-thin) 0; + margin-top: calc(var(--borderWidth-thin)* -1); +} + +.flash-warn:not(.Banner) { + background-image: linear-gradient(var(--bgColor-attention-muted), var(--bgColor-attention-muted)) !important; + border-color: var(--borderColor-attention-muted) !important; + color: var(--fgColor-default) !important; +} + +.flash-green:not(.Banner) { + background-image: linear-gradient(#43a17259, #78df3533) !important; + border-color: #38bb0966 !important; + color: var(--fgColor-default) !important; +} + + +.flash:not(.Banner) { + border-style: solid; + padding: var(--base-size-20) var(--control-medium-paddingInline-spacious); + position: relative; +} + +.flash-banner, .flash-full { + background-color: var(--bgColor-default); +} + +.text-bold { + font-weight: var(--base-text-weight-semibold, 600) !important; +} + +.text-center { + text-align: center !important; +} + +.py-2 { + padding-top: 8px !important; + padding-bottom: 6px !important; +} + +.border-top-0 { + box-sizing: border-box; + border-top: 0 !important; +} + +.banner-content { + display: inline-flex !important; + align-items: center; + letter-spacing: .58px; + text-align-last: justify; /* 窄宽度适配 */ +} + +.split-w { + width: 5.8px; +} + +:root { + --boxShadow-thin: inset 0 0 0 max(1px, 0.0625rem); + --boxShadow-thick: inset 0 0 0 max(2px, 0.125rem); + --boxShadow-thicker: inset 0 0 0 max(4px, 0.25rem); + --borderWidth-thin: max(1px, 0.0625rem); + --borderWidth-thick: max(2px, 0.125rem); + --borderWidth-thicker: max(4px, 0.25rem); + --borderRadius-small: 0.1875rem; + --borderRadius-medium: 0.375rem; + --borderRadius-large: 0.75rem; + --borderRadius-full: 624.9375rem; + --outline-focus-offset: -0.125rem; + --outline-focus-width: 0.125rem; +} + +:root { + --base-size-20: 1.25rem; + --control-medium-paddingInline-spacious: 1rem; +} + +[data-theme="light"]:root { + --bgColor-attention-muted: #fff8c5; + --borderColor-attention-muted: #d4a72c66; + --fgColor-default: #1f2328; +} +[data-theme="dark"]:root { + --bgColor-attention-muted: #bb800926; + --borderColor-attention-muted: #bb800966; + --fgColor-default: #e6edf3; +} diff --git a/package.json b/package.json index eb50b65296..c8a161dd64 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,13 @@ { - "name": "Sillot-workspace", + "name": "sillot-workspace", "version": "0.35.24072117", + "syv": "3.1.2", + "sypv": "[3.0.16, 3.0.17, 3.1.0, 3.1.1]", "description": "汐洛 pnpm 工作区", "packageManager": "pnpm@9.5.0", + "actionInstallCommand": "pnpm install --no-frozen-lockfile", + "homepage": "https://sillot.db.sc.cn", + "repository": "https://github.com/Hi-Windom/Sillot", "scripts": { "app:build": "pnpm -F ./app run gentpl && pnpm -F ./app run /build:.*/", "app:b:lint": "pnpm -F ./app run b:lint", @@ -28,5 +33,8 @@ "webpack": "^5.92.1", "webpack-bundle-analyzer": "^4.10.1", "webpack-cli": "^5.1.4" + }, + "resolutions": { + "lodash": "4.17.21" } -} \ No newline at end of file +}