From a8c630cbc8f97015edd2864fefa919255ceb2568 Mon Sep 17 00:00:00 2001 From: Ap_Tx <3045929398@qq.com> Date: Fri, 25 Sep 2026 22:19:19 +0800 Subject: [PATCH] =?UTF-8?q?chore(ci):=20Release=20=E5=B8=A6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=AF=B4=E6=98=8E=E5=B9=B6=E7=A7=BB=E9=99=A4=20CNB=20?= =?UTF-8?q?=E6=BA=90=E7=A0=81=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - build-on-tag.yml 改为三段式:preflight 从 announcement catalog 生成中英双语更新说明并创建带说明的 draft release,build 各平台 仅上传产物,publish 在所有平台完成后把 draft 转为正式发布。 - 移除 sync-cnb-source.yml:不再向 CNB 镜像源码(避免打 tag 时 触发额外流水线,以及默认上游仓库带来的误推风险)。 - catalog.ts 新增 1.0.1-beta1 版本公告,作为该版本 Release 说明 的来源。 --- .github/workflows/build-on-tag.yml | 75 ++++++++++++++++++- .github/workflows/sync-cnb-source.yml | 69 ----------------- .../app-frontend/src/announcements/catalog.ts | 68 +++++++++++++++++ 3 files changed, 140 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/sync-cnb-source.yml diff --git a/.github/workflows/build-on-tag.yml b/.github/workflows/build-on-tag.yml index 3298de4..0d190a4 100644 --- a/.github/workflows/build-on-tag.yml +++ b/.github/workflows/build-on-tag.yml @@ -16,8 +16,63 @@ concurrency: cancel-in-progress: false jobs: + # 先生成该版本的更新说明(来自 announcement catalog)并创建带说明的 draft + # release;随后各平台 build 只负责上传产物,最后由 publish 转正。 + preflight: + name: Prepare release + runs-on: ubuntu-24.04 + env: + SQLX_OFFLINE: true + steps: + - name: Check out source + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + submodules: recursive + + - name: Set up pnpm + uses: pnpm/action-setup@008330803749db0355799c700092d9a85fd074e9 # v6.0.9 + + - name: Set up Node.js + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + with: + node-version-file: .nvmrc + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Generate release notes + run: node scripts/axolotl/create-release-notes.mjs "${GITHUB_REF_NAME}" "${RUNNER_TEMP}/release-notes.md" + + - name: Create draft release with notes + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + release_notes="${RUNNER_TEMP}/release-notes.md" + existing_release="$( + gh release list --limit 100 --json tagName \ + --jq ".[] | select(.tagName == \"${GITHUB_REF_NAME}\") | .tagName" + )" + if [[ -n "$existing_release" ]]; then + echo "Release ${GITHUB_REF_NAME} already exists" + gh release edit "${GITHUB_REF_NAME}" --notes-file "$release_notes" + exit 0 + fi + + release_args=( + --draft + --notes-file "$release_notes" + --title "Starlight Launcher ${GITHUB_REF_NAME}" + ) + if [[ "${GITHUB_REF_NAME}" == *-* ]]; then + release_args+=(--prerelease) + fi + gh release create "${GITHUB_REF_NAME}" "${release_args[@]}" + build: name: Build (${{ matrix.name }}) + needs: preflight strategy: fail-fast: false max-parallel: 4 @@ -111,8 +166,7 @@ jobs: tauriScript: pnpm tauri args: ${{ matrix.args }} tagName: ${{ github.ref_name }} - releaseName: Starlight Launcher ${{ github.ref_name }} - releaseDraft: false + releaseDraft: true prerelease: ${{ contains(github.ref_name, '-') }} generateReleaseNotes: false includeUpdaterJson: false @@ -203,4 +257,19 @@ jobs: gh release upload "${{ github.ref_name }}" "$zipPath" --clobber } else { throw "Binary not found at $appExe" - } \ No newline at end of file + } + # 所有平台构建完成后,把 preflight 创建的 draft release 转为正式发布。 + publish: + name: Publish release + needs: build + runs-on: ubuntu-24.04 + steps: + - name: Publish release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [[ "${GITHUB_REF_NAME}" == *-* ]]; then + gh release edit "${GITHUB_REF_NAME}" --draft=false --prerelease + else + gh release edit "${GITHUB_REF_NAME}" --draft=false --latest + fi \ No newline at end of file diff --git a/.github/workflows/sync-cnb-source.yml b/.github/workflows/sync-cnb-source.yml deleted file mode 100644 index 96f5fa6..0000000 --- a/.github/workflows/sync-cnb-source.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Sync source to CNB - -on: - push: - branches: - - '**' - tags: - - '**' - delete: - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: sync-cnb-source-${{ github.event_name == 'delete' && format('{0}/{1}', github.event.ref_type, github.event.ref) || github.ref }} - cancel-in-progress: false - -jobs: - sync: - name: Sync Git ref - runs-on: ubuntu-24.04 - timeout-minutes: 5 - steps: - - name: Check out source - if: ${{ github.event_name != 'delete' }} - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: blob:none - - - name: Push Git ref to CNB - env: - CNB_REPO_URL_HTTPS: ${{ secrets.CNB_REPO_URL_HTTPS }} - CNB_TOKEN: ${{ secrets.CNB_TOKEN }} - CNB_TOKEN_USER_NAME: ${{ secrets.CNB_TOKEN_USER_NAME }} - DELETED_REF: ${{ github.event.ref }} - DELETED_REF_TYPE: ${{ github.event.ref_type }} - run: | - set -euo pipefail - if [[ -z "${CNB_TOKEN:-}" ]]; then - echo "CNB_TOKEN is not configured" - exit 1 - fi - - cnb_url="${CNB_REPO_URL_HTTPS:-https://cnb.cool/axlmc/Axolotl.git}" - token_user="${CNB_TOKEN_USER_NAME:-cnb}" - auth="$(printf '%s:%s' "$token_user" "$CNB_TOKEN" | base64 -w0)" - git_cnb() { - git -c "http.extraHeader=Authorization: Basic $auth" "$@" - } - - if [[ "$GITHUB_EVENT_NAME" == "delete" ]]; then - git init - if [[ "$DELETED_REF_TYPE" == "tag" ]]; then - ref="refs/tags/$DELETED_REF" - else - ref="refs/heads/$DELETED_REF" - fi - git_cnb push "$cnb_url" --delete "$ref" - else - if [[ "$GITHUB_REF" == refs/tags/* ]]; then - git fetch --force origin "$GITHUB_REF:$GITHUB_REF" - source_ref="$GITHUB_REF" - else - source_ref="HEAD" - fi - git_cnb push --force "$cnb_url" "$source_ref:$GITHUB_REF" - fi diff --git a/apps/app-frontend/src/announcements/catalog.ts b/apps/app-frontend/src/announcements/catalog.ts index bd210ef..5b74b74 100644 --- a/apps/app-frontend/src/announcements/catalog.ts +++ b/apps/app-frontend/src/announcements/catalog.ts @@ -32,6 +32,74 @@ export const ANNOUNCEMENT_CHANGE_TYPES: readonly AnnouncementChangeType[] = [ ] export const launcherAnnouncements: readonly LauncherAnnouncement[] = [ + { + id: 'launcher-1.0.1-beta1', + version: '1.0.1-beta1', + publishedAt: '2026-09-25', + title: { + 'en-US': 'Starlight Launcher 1.0.1-beta1', + 'zh-CN': 'Starlight Launcher 1.0.1-beta1', + }, + changes: { + added: [ + { + 'en-US': + 'Installing a modpack now lets you choose the game directory.', + 'zh-CN': '一键安装整合包时现在可以选择游戏目录。', + }, + { + 'en-US': + 'Approved (hosted) modpack sync and StarLight instance mode were added.', + 'zh-CN': '新增获批整合包同步与 StarLight 实例模式。', + }, + { + 'en-US': + 'Added the skin editor, improved font settings, and polished the about page (including an easter egg).', + 'zh-CN': '新增皮肤编辑器、改进字体设置,并完善关于页(含彩蛋)。', + }, + ], + changed: [ + { + 'en-US': + 'The about page now plays a looping wither victory animation.', + 'zh-CN': '关于页现在会播放循环的凋灵胜利动画。', + }, + ], + fixed: [ + { + 'en-US': + 'Fixed several issues when importing an instance from a .minecraft folder (content copy, version isolation, symlinks, loader version detection).', + 'zh-CN': + '修复从 .minecraft 文件夹导入实例的多项问题(内容复制、版本隔离、符号链接、加载器版本识别等)。', + }, + { + 'en-US': + 'Fixed the instance log view stopping updates and overlapping log lines.', + 'zh-CN': '修复实例日志窗口停更与日志行重叠的问题。', + }, + { + 'en-US': + 'Fixed hosted (SLS) instances leaving external data behind on delete and reusing the same folder on reinstall.', + 'zh-CN': '修复 SLS 实例删除残留外部数据、重装共用同一文件夹的问题。', + }, + { + 'en-US': + 'Fixed the sidebar player picker not appearing right after signing in to the skin site.', + 'zh-CN': '修复登录皮肤站后侧栏玩家选择器未立即显示的问题。', + }, + { + 'en-US': + 'Fixed launches getting stuck and the player picker not reappearing when not signed in to the skin site.', + 'zh-CN': '修复未登录皮肤站时启动卡住且不再弹出玩家选择的问题。', + }, + { + 'en-US': + 'Fixed various skin site login, player list sync, and display issues.', + 'zh-CN': '修复皮肤站登录、玩家列表同步及若干显示问题。', + }, + ], + }, + }, { id: 'launcher-1.0.0-beta1', version: '1.0.0-beta1',