diff --git a/.drone.yml b/.drone.yml index 3236b46..341c54c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -39,25 +39,38 @@ steps: test "$(git rev-parse HEAD)" = "$DRONE_COMMIT_SHA" || { echo 'Checked out commit does not match this build'; exit 1; } git log -1 --format='Checked out commit: %H' - # docker 打包 - - name: docker - image: plugins/docker - settings: - context: ./ - dockerfile: ./Dockerfile - build_args_from_env: - - http_proxy - - https_proxy - - no_proxy - - HTTP_PROXY - - HTTPS_PROXY - - NO_PROXY - username: - from_secret: docker_username - password: - from_secret: docker_password - registry: https://registry.cn-hangzhou.aliyuncs.com - repo: registry.cn-hangzhou.aliyuncs.com/hub_z/webproxy - tags: - - latest + - name: frontend-build + image: node:22.19.0-alpine + commands: + - npm --prefix web ci --no-audit --no-fund + - npm --prefix web run build + - name: build-binaries + image: golang:1.25.0-alpine + environment: + GOTOOLCHAIN: go1.25.0 + CGO_ENABLED: "0" + commands: + - apk add --no-cache git + - sh scripts/build-ci-release.sh + + - name: package + image: node:22.19.0-alpine + commands: + - apk add --no-cache libarchive-tools curl + - node --test scripts/ci-release.test.mjs + - node scripts/verify-package.mjs bin/build-cache/ci-release/linux-amd64/serviceport + - node scripts/ci-release.mjs package + + - name: upload-ipfs + image: node:22.19.0-alpine + environment: + IPFS_API: https://ipfs.freeicu.top + IPFS_TOKEN: "674d69308edc52450a5fff0e64947703de3d47d723810b53833ec9d4e999f20e" + commands: + - apk add --no-cache curl + - node scripts/ci-release.mjs upload + when: + event: + - push + - tag diff --git a/docs/change-rationale.md b/docs/change-rationale.md index 1acd5ba..9190304 100644 --- a/docs/change-rationale.md +++ b/docs/change-rationale.md @@ -1,5 +1,9 @@ # 变更原因与设计记录 +## 基于可触发配置替换发布步骤(2026-09-24) + +原因:用户确认恢复原始配置后可正常触发。以该版本为基准,仅把原 plugins/docker 步骤替换为前端编译、六平台编译、归档验证及 IPFS 上传;头部、代理和 clone 不变,不添加 type、platform 或顶层 trigger。仅上传步骤限制 push/tag。按用户明确要求,IPFS_TOKEN 明文配置,无需 Secret;仓库及历史读者可获取令牌,需限制访问并在泄露时轮换。无应用或数据库迁移。验证发布脚本测试与配置前缀一致性、git diff --check;未运行远端 Drone,不能认定触发故障根因或宣称已恢复。 + ## Drone 省略显式流水线类型(2026-09-24) 原因:用户反馈现有 Drone 环境添加 `type: docker` 后不执行打包,要求移除。仅删除 `.drone.yml` 的显式类型字段,保留平台、事件、六平台打包及 IPFS 上传步骤;不修改应用、产物格式或数据,无数据迁移。尚未取得服务端日志,不能认定通用根因或保证删除后恢复。实际验证:本地差异检查及 `git diff --check`;未触发远端 Drone,恢复情况需用新提交构建确认。 diff --git a/docs/ipfs.md b/docs/ipfs.md index c40d095..c3aee51 100644 --- a/docs/ipfs.md +++ b/docs/ipfs.md @@ -2,7 +2,7 @@ 当前 `.drone.yml` 不再构建或推送 Docker 镜像,也不依赖镜像仓库账号密码。流水线直接编译 Windows、Linux、macOS 的 amd64/arm64 程序,为每个平台保留独立压缩包,逐个上传并分别请求 pin,再发布一个四文件的下载索引目录。 -根据用户在现有 Drone 环境中的反馈,流水线省略显式 `type: docker`,保留现有 Docker runner 的构建步骤。`Dockerfile` 不参与此流水线,原有本地 Windows 单 EXE 打包入口保持不变。调整后的触发结果仍需在实际 Drone 环境验证。 +以用户确认能触发的原始配置为基准,仅替换原镜像发布步骤;保留头部、代理和 clone,不添加 `type`、`platform` 或顶层 `trigger`。IPFS 上传步骤只在 push/tag 执行。`Dockerfile` 不参与此流水线,原有本地 Windows 单 EXE 打包入口保持不变。调整后的触发结果仍需在实际 Drone 环境验证。 ## 流水线与平台包 @@ -10,7 +10,7 @@ 2. 使用 Node 22.19.0 执行前端生产构建。 3. 使用 Go 1.25.0、`CGO_ENABLED=0` 依次交叉编译六个平台,内嵌前端页面及版本、完整提交 ID、构建时间。 4. 执行发布脚本测试,并用 Linux amd64 程序在隔离临时数据库和端口上验证版本、启动、网页资源及登录,然后生成六个独立压缩包。 -5. push/tag 上传 IPFS;pull_request 只编译、验证和打包,不读取发布 Secret、不上传。 +5. push/tag 上传 IPFS;pull_request 只编译、验证和打包,不执行上传步骤。按用户要求,令牌直接配置在 YAML 中,不依赖 Drone Secret;仓库读者可以看到令牌,跳过上传步骤不代表令牌对 PR 隐藏。 | 系统 | 架构 | 文件名 | | --- | --- | --- |