From 7dddc06de771cfa13d2cca8879ea5d6c3f8be86a Mon Sep 17 00:00:00 2001 From: wgqqqqq <1120619671@qq.com> Date: Sat, 14 Feb 2026 09:57:19 +0800 Subject: [PATCH 1/3] chore(release): prepare v0.1.1 and increase build memory --- .github/workflows/ci.yml | 2 ++ .github/workflows/desktop-package.yml | 2 ++ .github/workflows/nightly.yml | 2 ++ .release-please-manifest.json | 2 +- Cargo.toml | 3 +-- package.json | 2 +- src/web-ui/package.json | 2 +- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cbb2d69..4a11a748 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,8 @@ jobs: frontend-build: name: Frontend Build runs-on: ubuntu-latest + env: + NODE_OPTIONS: --max-old-space-size=6144 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/desktop-package.yml b/.github/workflows/desktop-package.yml index fcc8a5f2..49c40925 100644 --- a/.github/workflows/desktop-package.yml +++ b/.github/workflows/desktop-package.yml @@ -56,6 +56,8 @@ jobs: name: Package (${{ matrix.platform.name }}) runs-on: ${{ matrix.platform.os }} needs: prepare + env: + NODE_OPTIONS: --max-old-space-size=6144 strategy: fail-fast: false diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a5c21cd0..17f847ff 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -65,6 +65,8 @@ jobs: runs-on: ${{ matrix.platform.os }} needs: check-changes if: needs.check-changes.outputs.should_build == 'true' + env: + NODE_OPTIONS: --max-old-space-size=6144 strategy: fail-fast: false diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 466df71c..a915e8c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "0.1.1" } diff --git a/Cargo.toml b/Cargo.toml index 93bcffa7..a06307ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ resolver = "2" # Shared package metadata — single source of truth for version [workspace.package] -version = "0.1.0" # x-release-please-version +version = "0.1.1" # x-release-please-version authors = ["BitFun Team"] edition = "2021" @@ -113,4 +113,3 @@ opt-level = 3 lto = true codegen-units = 1 strip = true - diff --git a/package.json b/package.json index e6986a15..369d2b36 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "BitFun", "private": true, - "version": "0.1.0", + "version": "0.1.1", "type": "module", "scripts": { "copy-monaco": "copyfiles -u 3 \"node_modules/monaco-editor/min/vs/**/*\" src/web-ui/public/monaco-editor", diff --git a/src/web-ui/package.json b/src/web-ui/package.json index b2b1e5f2..10ba187f 100644 --- a/src/web-ui/package.json +++ b/src/web-ui/package.json @@ -1,6 +1,6 @@ { "name": "@bitfun/web-ui", - "version": "0.1.0", + "version": "0.1.1", "description": "BitFun Web UI - 支持 Desktop 和 Server 两种部署方式", "type": "module", "scripts": { From 6a955e83e4a8d939909ffb0d2128695f1dd8ed6a Mon Sep 17 00:00:00 2001 From: wgqqqqq <1120619671@qq.com> Date: Sat, 14 Feb 2026 09:59:45 +0800 Subject: [PATCH 2/3] ci(release): auto publish on version bump --- .github/workflows/release-please.yml | 90 ++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 26 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 876e84f8..6af6fce8 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,4 +1,4 @@ -name: Release Please +name: Release On Version Bump on: push: @@ -6,34 +6,72 @@ on: permissions: contents: write - pull-requests: write jobs: - release-please: - name: Release Please + create-release: + name: Create Release runs-on: ubuntu-latest - outputs: - release_created: ${{ steps.release.outputs.release_created }} - tag_name: ${{ steps.release.outputs.tag_name }} - version: ${{ steps.release.outputs.version }} steps: - - uses: googleapis/release-please-action@v4 - id: release + - uses: actions/checkout@v4 with: - config-file: release-please-config.json - manifest-file: .release-please-manifest.json - - # When a release is created, trigger the desktop package workflow - trigger-package: - name: Trigger Desktop Package - needs: release-please - if: ${{ needs.release-please.outputs.release_created }} - runs-on: ubuntu-latest - permissions: - actions: write - contents: read - steps: - - name: Log release info + fetch-depth: 0 + + - name: Detect version bump + id: detect + shell: bash + env: + BEFORE_SHA: ${{ github.event.before }} run: | - echo "Release created: ${{ needs.release-please.outputs.tag_name }}" - echo "Version: ${{ needs.release-please.outputs.version }}" + set -euo pipefail + + CURRENT_VERSION="$(jq -r '.version' package.json)" + TAG_NAME="v${CURRENT_VERSION}" + + echo "current_version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT" + echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT" + + # First push to branch or unknown previous commit + if [[ -z "${BEFORE_SHA}" || "${BEFORE_SHA}" =~ ^0+$ ]]; then + echo "should_release=false" >> "$GITHUB_OUTPUT" + echo "reason=before_sha_unavailable" >> "$GITHUB_OUTPUT" + exit 0 + fi + + PREV_VERSION="$(git show "${BEFORE_SHA}:package.json" 2>/dev/null | jq -r '.version' 2>/dev/null || true)" + + if [[ -z "${PREV_VERSION}" ]]; then + echo "should_release=false" >> "$GITHUB_OUTPUT" + echo "reason=previous_version_unavailable" >> "$GITHUB_OUTPUT" + exit 0 + fi + + if [[ "$CURRENT_VERSION" == "$PREV_VERSION" ]]; then + echo "should_release=false" >> "$GITHUB_OUTPUT" + echo "reason=version_unchanged" >> "$GITHUB_OUTPUT" + exit 0 + fi + + if git ls-remote --exit-code --tags origin "refs/tags/${TAG_NAME}" >/dev/null 2>&1; then + echo "should_release=false" >> "$GITHUB_OUTPUT" + echo "reason=tag_exists" >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "previous_version=$PREV_VERSION" >> "$GITHUB_OUTPUT" + echo "should_release=true" >> "$GITHUB_OUTPUT" + echo "reason=version_changed" >> "$GITHUB_OUTPUT" + + - name: Log decision + shell: bash + run: | + echo "Decision: ${{ steps.detect.outputs.reason }}" + echo "Current version: ${{ steps.detect.outputs.current_version }}" + echo "Tag: ${{ steps.detect.outputs.tag_name }}" + + - name: Create GitHub release + if: steps.detect.outputs.should_release == 'true' + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.detect.outputs.tag_name }} + target_commitish: ${{ github.sha }} + generate_release_notes: true From cff6af717094603e2644ebf337fa1ada77d9b0be Mon Sep 17 00:00:00 2001 From: wgqqqqq <1120619671@qq.com> Date: Sat, 14 Feb 2026 10:19:07 +0800 Subject: [PATCH 3/3] ci: skip test targets in rust check and fix desktop release dispatch --- .github/workflows/ci.yml | 2 +- .github/workflows/desktop-package.yml | 18 +++++++++++++++--- .github/workflows/release-please.yml | 18 ++++++++++++++++++ Cargo.toml | 1 + src/apps/desktop/Cargo.toml | 1 + 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a11a748..1ae43717 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: shared-key: "ci-check" - name: Check compilation - run: cargo check --all-targets + run: cargo check --workspace # ── Frontend: build ──────────────────────────────────────────────── frontend-build: diff --git a/.github/workflows/desktop-package.yml b/.github/workflows/desktop-package.yml index 49c40925..6cc053e7 100644 --- a/.github/workflows/desktop-package.yml +++ b/.github/workflows/desktop-package.yml @@ -11,6 +11,11 @@ on: description: "Tag name to build (e.g. v0.2.0). Leave empty to build from HEAD." required: false type: string + upload_to_release: + description: "Upload built artifacts to the release specified by tag_name." + required: false + default: false + type: boolean permissions: contents: write @@ -30,6 +35,9 @@ jobs: - name: Resolve version metadata id: meta shell: bash + env: + INPUT_TAG_NAME: ${{ inputs.tag_name }} + INPUT_UPLOAD_TO_RELEASE: ${{ inputs.upload_to_release }} run: | set -euo pipefail @@ -37,10 +45,14 @@ jobs: TAG="${{ github.event.release.tag_name }}" VERSION="${TAG#v}" UPLOAD="true" - elif [[ -n "${{ inputs.tag_name }}" ]]; then - TAG="${{ inputs.tag_name }}" + elif [[ -n "${INPUT_TAG_NAME}" ]]; then + TAG="${INPUT_TAG_NAME}" VERSION="${TAG#v}" - UPLOAD="false" + if [[ "${INPUT_UPLOAD_TO_RELEASE}" == "true" ]]; then + UPLOAD="true" + else + UPLOAD="false" + fi else VERSION="$(jq -r '.version' package.json)" TAG="v${VERSION}" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6af6fce8..024d20f7 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -6,6 +6,7 @@ on: permissions: contents: write + actions: write jobs: create-release: @@ -75,3 +76,20 @@ jobs: tag_name: ${{ steps.detect.outputs.tag_name }} target_commitish: ${{ github.sha }} generate_release_notes: true + + - name: Trigger desktop package workflow + if: steps.detect.outputs.should_release == 'true' + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: "desktop-package.yml", + ref: context.ref.replace("refs/heads/", ""), + inputs: { + tag_name: "${{ steps.detect.outputs.tag_name }}", + upload_to_release: "true" + } + }); diff --git a/Cargo.toml b/Cargo.toml index a06307ba..18670f39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -89,6 +89,7 @@ eventsource-stream = "0.2.3" # Command detection (cross-platform) which = "8.0" similar = "2.5" +urlencoding = "2.1" # Tauri (desktop only) tauri = { version = "2", features = [] } diff --git a/src/apps/desktop/Cargo.toml b/src/apps/desktop/Cargo.toml index ad555b60..76a4d1ce 100644 --- a/src/apps/desktop/Cargo.toml +++ b/src/apps/desktop/Cargo.toml @@ -42,6 +42,7 @@ once_cell = { workspace = true } similar = { workspace = true } dashmap = { workspace = true } ignore = { workspace = true } +urlencoding = { workspace = true } [target.'cfg(windows)'.dependencies] win32job = { workspace = true }