From 47869ea32d47a5a2ea9ac7d124fa09bcc1f16b22 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 00:35:09 +0800 Subject: [PATCH 01/10] delete old action, create new action to build,pack and release dapp --- .github/workflows/build.yml | 58 +++++++++++++++++ .github/workflows/ci.yaml | 115 --------------------------------- .github/workflows/docs.yml | 52 --------------- .github/workflows/lint-pr.yaml | 46 ------------- HOW_TO_BUILD.md | 26 ++++++++ 5 files changed, 84 insertions(+), 213 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/lint-pr.yaml create mode 100644 HOW_TO_BUILD.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..dd755fbf55 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,58 @@ +name: Build Filebrowser for Buckyos App + +on: + workflow_dispatch: + +jobs: + build-all-platforms: + name: Build All Platforms + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: actions/setup-go@v6 + with: + go-version: '1.25' + - name: Install Task + uses: go-task/setup-task@v1 + - uses: actions/setup-node@v6 + with: + node-version: "24.x" + cache: "pnpm" + cache-dependency-path: "frontend/pnpm-lock.yaml" + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Get Dapp Version + id: get_version + run: | + VERSION=$(python3 -c "import json; print(json.load(open('publish/app_pkg/pkg_meta.json'))['version'])") + echo "DAPP_VERSION=$VERSION" >> $GITHUB_OUTPUT + - name: Build Filebrowser Dapp + run: | + python3 build_dapp.py + - name: Write Identify File + run: | + mkdir -p ~/.buckycli + base64 -d <<< ${{github.secrets.NODE_IDENTIFY_BASE64}} > ~/.buckycli/node_identify.json + base64 -d <<< ${{github.secrets.NODE_PRIVATE_KEY_BASE64}} > ~/.buckycli/node_private_key.pem + base64 -d <<< ${{github.secrets.USER_CONFIG_BASE64}} > ~/.buckycli/user_config.json + base64 -d <<< ${{github.secrets.USER_PRIVATE_KEY_BASE64}} > ~/.buckycli/user_private_key.pem + - name: Pack Dapp + run: | + python3 pack_dapp.py + - name: Tar Dapp Package + run: | + tar -zvcf filebrowser.tar.gz -C /opt/buckyosci/apps buckyos_filebrowser + - name: Generate Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.get_version.outputs.DAPP_VERSION }} + name: filebrowser-v${{ steps.get_version.outputs.DAPP_VERSION }} + generate_release_notes: true + fail_on_unmatched_files: true + files: filebrowser.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 846b08f8f1..0000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,115 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: - - "master" - tags: - - "v*" - pull_request: - -jobs: - lint-frontend: - name: Lint Frontend - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: pnpm/action-setup@v4 - with: - package_json_file: "frontend/package.json" - - uses: actions/setup-node@v6 - with: - node-version: "24.x" - cache: "pnpm" - cache-dependency-path: "frontend/pnpm-lock.yaml" - - working-directory: frontend - run: | - pnpm install --frozen-lockfile - pnpm run lint - - lint-backend: - name: Lint Backend - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 - with: - go-version: "1.25.x" - - uses: golangci/golangci-lint-action@v9 - with: - version: "latest" - - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-go@v6 - with: - go-version: "1.25.x" - - run: go test --race ./... - - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - uses: actions/setup-go@v6 - with: - go-version: '1.25' - - uses: pnpm/action-setup@v4 - with: - package_json_file: "frontend/package.json" - - uses: actions/setup-node@v6 - with: - node-version: "24.x" - cache: "pnpm" - cache-dependency-path: "frontend/pnpm-lock.yaml" - - name: Install Task - uses: go-task/setup-task@v1 - - run: task build - - release: - name: Release - needs: ["lint-frontend", "lint-backend", "test", "build"] - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - uses: actions/setup-go@v6 - with: - go-version: '1.25' - - uses: pnpm/action-setup@v4 - with: - package_json_file: "frontend/package.json" - - uses: actions/setup-node@v6 - with: - node-version: "24.x" - cache: "pnpm" - cache-dependency-path: "frontend/pnpm-lock.yaml" - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Install Task - uses: go-task/setup-task@v1 - - run: task build:frontend - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 - with: - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GH_PAT }} - - - diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 5b21ccba79..0000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Docs - -on: - pull_request: - paths: - - 'www' - - '*.md' - push: - branches: - - master - -jobs: - build: - name: Build Docs - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Install Task - uses: go-task/setup-task@v1 - - name: Build site - run: task docs - - build-and-release: - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - name: Build and Release Docs - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Install Task - uses: go-task/setup-task@v1 - - name: Build site - run: task docs - - name: Upload static files as artifact - uses: actions/upload-pages-artifact@v4 - with: - path: www/public - - name: Deploy to GitHub Pages - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml deleted file mode 100644 index f00f44150f..0000000000 --- a/.github/workflows/lint-pr.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: "Lint PR" - -on: - pull_request_target: - types: - - opened - - reopened - - edited - - synchronize - -permissions: - pull-requests: write - -jobs: - main: - name: Validate Title - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v6 - id: lint_pr_title - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - uses: marocchino/sticky-pull-request-comment@v2 - # When the previous steps fails, the workflow would stop. By adding this - # condition you can continue the execution with the populated error message. - if: always() && (steps.lint_pr_title.outputs.error_message != null) - with: - header: pr-title-lint-error - message: | - Hey there and thank you for opening this pull request! 👋🏼 - - We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. - - Details: - - ``` - ${{ steps.lint_pr_title.outputs.error_message }} - ``` - - # Delete a previous comment when the issue has been resolved - - if: ${{ steps.lint_pr_title.outputs.error_message == null }} - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: pr-title-lint-error - delete: true diff --git a/HOW_TO_BUILD.md b/HOW_TO_BUILD.md new file mode 100644 index 0000000000..a2597102b7 --- /dev/null +++ b/HOW_TO_BUILD.md @@ -0,0 +1,26 @@ +以下说明适用于linux机器 + +## 准备依赖 +- go task: https://taskfile.dev/docs/installation +- nodejs and pnpm: https://nodejs.org/zh-cn/download +- go: https://go.dev/doc/install +- 正确安装官方docker,需要buildx-plugin +- 执行`docker buildx create --use` +- `docker run --rm --privileged multiarch/qemu-user-static --reset -p yes`启用多平台支持 +- 准备正确版本的buckycli程序和身份信息,打包环节需要用到 + +## 修改appdoc文件 +修改`./publish/app.doc.json`文件: +- pkg_name: app包名,同一owner的包名必须不同 +- version:版本号。推荐使用符合semver规则的三位数字版本号 + +## 编译-打包-发布流程 +1. 在根目录下执行python3 build_dapp.py进行全平台编译 + > 可以配置环境变量BUCKYOS_BUILD_ROOT,指定编译结果的输出目录。默认为`/opt/buckyosci` + + > 编译结果输出到`${BUCKYOS_BUILD_ROOT}/app_build/${pkg_name}${version}` +2. 在根目录执行python3 pack_dapp.py进行打包操作 + > 可以通过环境变量BUCKYCLI_PATH指定buckycli程序的位置,默认为`/opt/buckyos/bin/buckycli/buckycli` + > 正确的身份文件必须放置在~/.buckycli目录下 + + > 打包结果输出到`${BUCKYOS_BUILD_ROOT}/app/${pkg_name}${version}` From fea904c338a31ad25f7165e3795fb19cb1e2f6d5 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 00:38:57 +0800 Subject: [PATCH 02/10] setup pnpm --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd755fbf55..1a03a0b844 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,11 +16,13 @@ jobs: go-version: '1.25' - name: Install Task uses: go-task/setup-task@v1 + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: "latest" - uses: actions/setup-node@v6 with: node-version: "24.x" - cache: "pnpm" - cache-dependency-path: "frontend/pnpm-lock.yaml" - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx From 44484bbb5a2dcb087ac35084771141f3c5a7e213 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 00:46:30 +0800 Subject: [PATCH 03/10] fix secret decode error --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a03a0b844..d5c75839c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,10 +38,10 @@ jobs: - name: Write Identify File run: | mkdir -p ~/.buckycli - base64 -d <<< ${{github.secrets.NODE_IDENTIFY_BASE64}} > ~/.buckycli/node_identify.json - base64 -d <<< ${{github.secrets.NODE_PRIVATE_KEY_BASE64}} > ~/.buckycli/node_private_key.pem - base64 -d <<< ${{github.secrets.USER_CONFIG_BASE64}} > ~/.buckycli/user_config.json - base64 -d <<< ${{github.secrets.USER_PRIVATE_KEY_BASE64}} > ~/.buckycli/user_private_key.pem + echo "${{github.secrets.NODE_IDENTIFY_BASE64}}" | base64 -d > ~/.buckycli/node_identify.json + echo "${{github.secrets.NODE_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/node_private_key.pem + echo "${{github.secrets.USER_CONFIG_BASE64}}" | base64 -d > ~/.buckycli/user_config.json + echo "${{github.secrets.USER_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/user_private_key.pem - name: Pack Dapp run: | python3 pack_dapp.py From 88f881bb0649ee7329367fb34b8af9adfe1da380 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 01:04:34 +0800 Subject: [PATCH 04/10] try to download buckycli from artifacts --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5c75839c5..672959267e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,9 +42,20 @@ jobs: echo "${{github.secrets.NODE_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/node_private_key.pem echo "${{github.secrets.USER_CONFIG_BASE64}}" | base64 -d > ~/.buckycli/user_config.json echo "${{github.secrets.USER_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/user_private_key.pem + - name: Download Buckycli + uses: actions/download-artifact@v5 + with: + name: buckyos-tools-linux-amd64-0.5.1+build260116 + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: buckyos/buckyos + run-id: 21052409212 + path: ~ - name: Pack Dapp run: | + chmod +x ~/buckycli python3 pack_dapp.py + env: + BUCKYOS_CLI_PATH: ~/buckycli - name: Tar Dapp Package run: | tar -zvcf filebrowser.tar.gz -C /opt/buckyosci/apps buckyos_filebrowser From 9d1384c7336ad93bb2517a90c13fc4642b1f544b Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 01:13:33 +0800 Subject: [PATCH 05/10] fix artifacts download path --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 672959267e..47ca4650bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,13 +49,17 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} repository: buckyos/buckyos run-id: 21052409212 - path: ~ + path: ${{github.workspace}} + - name: Check Buckycli and Identify Files + run: | + ls -la ~/.buckycli + ls -la ${{github.workspace}}/buckycli + chmod +x ${{github.workspace}}/buckycli - name: Pack Dapp run: | - chmod +x ~/buckycli python3 pack_dapp.py env: - BUCKYOS_CLI_PATH: ~/buckycli + BUCKYOS_CLI_PATH: ${{github.workspace}}/buckycli - name: Tar Dapp Package run: | tar -zvcf filebrowser.tar.gz -C /opt/buckyosci/apps buckyos_filebrowser From a6d5a2f10217b34bf6f8dfb9b2a13544eceb46fd Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 01:14:23 +0800 Subject: [PATCH 06/10] prepare buckycli first --- .github/workflows/build.yml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47ca4650bc..055d68e6ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,26 @@ jobs: - uses: actions/checkout@v6 with: fetch-depth: 0 + - name: Write Identify File + run: | + mkdir -p ~/.buckycli + echo "${{github.secrets.NODE_IDENTIFY_BASE64}}" | base64 -d > ~/.buckycli/node_identify.json + echo "${{github.secrets.NODE_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/node_private_key.pem + echo "${{github.secrets.USER_CONFIG_BASE64}}" | base64 -d > ~/.buckycli/user_config.json + echo "${{github.secrets.USER_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/user_private_key.pem + - name: Download Buckycli + uses: actions/download-artifact@v5 + with: + name: buckyos-tools-linux-amd64-0.5.1+build260116 + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: buckyos/buckyos + run-id: 21052409212 + path: ${{github.workspace}} + - name: Check Buckycli and Identify Files + run: | + ls -la ~/.buckycli + ls -la ${{github.workspace}}/buckycli + chmod +x ${{github.workspace}}/buckycli - uses: actions/setup-go@v6 with: go-version: '1.25' @@ -35,26 +55,6 @@ jobs: - name: Build Filebrowser Dapp run: | python3 build_dapp.py - - name: Write Identify File - run: | - mkdir -p ~/.buckycli - echo "${{github.secrets.NODE_IDENTIFY_BASE64}}" | base64 -d > ~/.buckycli/node_identify.json - echo "${{github.secrets.NODE_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/node_private_key.pem - echo "${{github.secrets.USER_CONFIG_BASE64}}" | base64 -d > ~/.buckycli/user_config.json - echo "${{github.secrets.USER_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/user_private_key.pem - - name: Download Buckycli - uses: actions/download-artifact@v5 - with: - name: buckyos-tools-linux-amd64-0.5.1+build260116 - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: buckyos/buckyos - run-id: 21052409212 - path: ${{github.workspace}} - - name: Check Buckycli and Identify Files - run: | - ls -la ~/.buckycli - ls -la ${{github.workspace}}/buckycli - chmod +x ${{github.workspace}}/buckycli - name: Pack Dapp run: | python3 pack_dapp.py From d2baf36c11054c5f6f16ad8525249fd15e9953e9 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 01:16:14 +0800 Subject: [PATCH 07/10] fix secrets --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 055d68e6ab..93ac902c8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,10 @@ jobs: - name: Write Identify File run: | mkdir -p ~/.buckycli - echo "${{github.secrets.NODE_IDENTIFY_BASE64}}" | base64 -d > ~/.buckycli/node_identify.json - echo "${{github.secrets.NODE_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/node_private_key.pem - echo "${{github.secrets.USER_CONFIG_BASE64}}" | base64 -d > ~/.buckycli/user_config.json - echo "${{github.secrets.USER_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/user_private_key.pem + echo "${{secrets.NODE_IDENTIFY_BASE64}}" | base64 -d > ~/.buckycli/node_identify.json + echo "${{secrets.NODE_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/node_private_key.pem + echo "${{secrets.USER_CONFIG_BASE64}}" | base64 -d > ~/.buckycli/user_config.json + echo "${{secrets.USER_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/user_private_key.pem - name: Download Buckycli uses: actions/download-artifact@v5 with: From 816bd377f51040fa9afcf4144b4822bc014550a8 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 01:23:44 +0800 Subject: [PATCH 08/10] buckycli path error --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93ac902c8d..88830c2dd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: run: | python3 pack_dapp.py env: - BUCKYOS_CLI_PATH: ${{github.workspace}}/buckycli + BUCKYCLI_PATH: ${{github.workspace}}/buckycli - name: Tar Dapp Package run: | tar -zvcf filebrowser.tar.gz -C /opt/buckyosci/apps buckyos_filebrowser From c66401ed31d136d7612ecb590fd2715ab87b2258 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 01:41:01 +0800 Subject: [PATCH 09/10] fix identity filename --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88830c2dd3..cae9f7ce40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - name: Write Identify File run: | mkdir -p ~/.buckycli - echo "${{secrets.NODE_IDENTIFY_BASE64}}" | base64 -d > ~/.buckycli/node_identify.json + echo "${{secrets.NODE_IDENTIFY_BASE64}}" | base64 -d > ~/.buckycli/node_identity.json echo "${{secrets.NODE_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/node_private_key.pem echo "${{secrets.USER_CONFIG_BASE64}}" | base64 -d > ~/.buckycli/user_config.json echo "${{secrets.USER_PRIVATE_KEY_BASE64}}" | base64 -d > ~/.buckycli/user_private_key.pem From cbed2698f0ad810228744f3e34ce76b1b5d5bbe7 Mon Sep 17 00:00:00 2001 From: weiqiushi Date: Sun, 18 Jan 2026 01:46:57 +0800 Subject: [PATCH 10/10] release name --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cae9f7ce40..ec401036df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,8 +66,8 @@ jobs: - name: Generate Release uses: softprops/action-gh-release@v1 with: - tag_name: v${{ steps.get_version.outputs.DAPP_VERSION }} - name: filebrowser-v${{ steps.get_version.outputs.DAPP_VERSION }} + tag_name: ${{ steps.get_version.outputs.DAPP_VERSION }} + name: filebrowser-${{ steps.get_version.outputs.DAPP_VERSION }} generate_release_notes: true fail_on_unmatched_files: true files: filebrowser.tar.gz