- shellInfo 拿到的版本号先过 toUTF8:utf8.Valid 为真(英文版 Windows 的 纯 ASCII、本来就是 UTF-8 的系统)原样返回,只有不是合法 UTF-8 时才按 GBK 解,解不出来保留原样。中文 Windows 的 `cmd /c ver` 是 GBK,之前 hello 上报的 shell_ver 显示成「Microsoft Windows [�汾 10.0.19045.7807]」。 - build.sh 的 all 目标补 linux/mips,并固定 GOMIPS=softfloat(AR9331 这类 OpenWrt 设备没有 FPU,硬浮点二进制一跑就是非法指令);docker 分支同步。 - version 0.1.0 → 0.1.1,两台设备版本号一致但代码不同的坑到此为止。
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
name: agent-device release
|
||
|
||
# 只认设备端标签(agent-device-v0.1.0),不碰主项目的 v2.5.0 这类版本号。
|
||
on:
|
||
push:
|
||
tags:
|
||
- 'agent-device-v*'
|
||
workflow_dispatch: # 兜底:页面上手动跑,填一个已存在的标签
|
||
inputs:
|
||
tag:
|
||
description: '要发布的标签(已存在),如 agent-device-v0.1.0'
|
||
required: true
|
||
|
||
permissions:
|
||
contents: write # action-gh-release 需要建 release、传附件
|
||
|
||
jobs:
|
||
release:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- uses: actions/setup-go@v5
|
||
with:
|
||
go-version-file: device/go.mod
|
||
cache-dependency-path: device/go.sum
|
||
|
||
# 复用仓库里的脚本,本地和 CI 一套目标列表
|
||
- name: 编译各平台
|
||
working-directory: device
|
||
run: sh scripts/build.sh all
|
||
|
||
- name: 发布 Release
|
||
uses: softprops/action-gh-release@v2
|
||
with:
|
||
name: ${{ inputs.tag || github.ref_name }}
|
||
tag_name: ${{ inputs.tag || github.ref_name }}
|
||
files: device/bin/agent-device-*
|
||
fail_on_unmatched_files: true
|
||
body: |
|
||
设备执行端 agent-device(`device/`)。
|
||
|
||
- 设备主动出站连 core 的 `/dev/ws`,不需要公网 IP、不需要开端口
|
||
- 二进制不含服务器地址与 token,启动时用 `-server` 或同目录 `config.json` 指定
|
||
- 模型侧可用 `device` 工具跑命令、看负载、收发文件
|
||
|
||
| 平台 | 文件 |
|
||
| --- | --- |
|
||
| Linux amd64 / arm64 / mips | `agent-device-linux-*` |
|
||
| macOS amd64 / arm64 | `agent-device-darwin-*` |
|
||
| Windows amd64 | `agent-device-windows-amd64.exe` |
|
||
|
||
`linux-mips` 是软浮点(`GOMIPS=softfloat`),给 AR9331 这类没 FPU 的 OpenWrt 设备用。
|