Skip to content

Commit 7731403

Browse files
committed
<update>: 初始化 fnm 环境以支持多平台构建
1 parent e87c805 commit 7731403

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/build-debug.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,30 @@ jobs:
2121
runs-on: [self-hosted, macOS, ARM64]
2222

2323
steps:
24+
- name: 登录到 GHCR
25+
uses: docker/login-action@v3
26+
with:
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.repository_owner }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: 检查 base-debug 可用性
32+
run: |
33+
docker push ghcr.io/${{ github.repository_owner }}/convertor/convd-debug:2.6.15-amd64 || echo convd-debug 镜像不可用,继续构建
34+
sleep 600
2435
- name: 检出代码
2536
uses: actions/checkout@v4
2637

2738
# 构建 builder 工具用于后续步骤
2839
- name: 构建 builder 工具
2940
run: cargo install --path crates/builder
3041

42+
- name: 初始化 fnm 环境
43+
run: |
44+
eval "$(fnm env --shell bash)"
45+
fnm use 24
46+
echo "$(dirname $(which node))" >> "$GITHUB_PATH"
47+
3148
- name: 安装 Dashboard 依赖
3249
run: pnpm install
3350
working-directory: dashboard

crates/builder/src/commands/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ impl ImageCommand {
103103
command
104104
}
105105

106+
#[allow(unused)]
106107
fn cleanup_remote_tag(&self, tag: &Tag, arch: Arch) -> Command {
107108
let mut command = Command::new("docker");
108109
command.arg("rmi").arg(tag.remote(&self.registry, Some(arch), None));
@@ -148,7 +149,6 @@ impl Commander for ImageCommand {
148149
for arch in self.arch.iter().copied() {
149150
commands.push(self.remote_tag_image(&tag, arch));
150151
commands.push(self.push_image(&tag, arch));
151-
commands.push(self.cleanup_remote_tag(&tag, arch));
152152
}
153153
// 最后创建多架构清单并推送,需要包含version标签和latest标签
154154
commands.push(self.manifest_image(&tag, &self.version));

0 commit comments

Comments
 (0)