feat(release): publish standalone CLI archives
This commit is contained in:
1 parent
4bcf618162
commit
3784c16aaf
4 files changed
+123
-3
No files matched your search
@@ -729,7 +729,7 @@ jobs:
|
|||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
cat > release-notes.md <<EOF
|
cat > release-notes.md <<EOF
|
||||||
DBX MCP ${VERSION} provides precompiled native binaries for macOS, Linux, and Windows.
|
DBX MCP and CLI ${VERSION} provide precompiled native binaries for macOS, Linux, and Windows.
|
||||||
|
|
||||||
Recommended npm installation:
|
Recommended npm installation:
|
||||||
|
|
||||||
@@ -739,20 +739,92 @@ jobs:
|
|||||||
|
|
||||||
Native archives run without Node.js. Download the archive matching your operating system and CPU, verify it with \`SHA256SUMS\`, extract \`dbx-mcp\` (or \`dbx-mcp.exe\`), and configure your MCP client to run it directly.
|
Native archives run without Node.js. Download the archive matching your operating system and CPU, verify it with \`SHA256SUMS\`, extract \`dbx-mcp\` (or \`dbx-mcp.exe\`), and configure your MCP client to run it directly.
|
||||||
|
|
||||||
|
The CLI archives use the \`dbx-cli-*\` prefix. Verify them with \`CLI-SHA256SUMS\`, extract \`dbx\` (or \`dbx.exe\`), and run it directly without Node.js.
|
||||||
|
|
||||||
This package release is separate from the DBX desktop application release and is intentionally not marked as the repository's latest release.
|
This package release is separate from the DBX desktop application release and is intentionally not marked as the repository's latest release.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if gh release view "${TAG}" >/dev/null 2>&1; then
|
if gh release view "${TAG}" >/dev/null 2>&1; then
|
||||||
gh release upload "${TAG}" release-assets/* --clobber
|
gh release upload "${TAG}" release-assets/* --clobber
|
||||||
gh release edit "${TAG}" --title "DBX MCP ${VERSION}" --notes-file release-notes.md --latest=false
|
gh release edit "${TAG}" --title "DBX Packages ${VERSION}" --notes-file release-notes.md --latest=false
|
||||||
else
|
else
|
||||||
gh release create "${TAG}" release-assets/* \
|
gh release create "${TAG}" release-assets/* \
|
||||||
--verify-tag \
|
--verify-tag \
|
||||||
--title "DBX MCP ${VERSION}" \
|
--title "DBX Packages ${VERSION}" \
|
||||||
--notes-file release-notes.md \
|
--notes-file release-notes.md \
|
||||||
--latest=false
|
--latest=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
publish-cli-github-release:
|
||||||
|
name: Publish CLI GitHub Release assets
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [prepare, publish-cli, publish-mcp-github-release]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
ref: ${{ needs.prepare.outputs.tag }}
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: 22.13.0
|
||||||
|
registry-url: https://registry.npmjs.org
|
||||||
|
|
||||||
|
- name: Build native CLI release archives from npm packages
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
mkdir -p release-assets
|
||||||
|
|
||||||
|
pack_unix() {
|
||||||
|
package_name="$1"
|
||||||
|
asset_name="$2"
|
||||||
|
work_dir="$(mktemp -d)"
|
||||||
|
npm pack "${package_name}@${VERSION}" --pack-destination "${work_dir}" --json > "${work_dir}/pack.json"
|
||||||
|
tarball="${work_dir}/$(jq -r '.[0].filename' "${work_dir}/pack.json")"
|
||||||
|
tar -xzf "${tarball}" -C "${work_dir}"
|
||||||
|
mkdir -p "${work_dir}/archive"
|
||||||
|
cp "${work_dir}/package/bin/dbx" "${work_dir}/archive/dbx"
|
||||||
|
chmod +x "${work_dir}/archive/dbx"
|
||||||
|
tar -C "${work_dir}/archive" -czf "release-assets/${asset_name}.tar.gz" dbx
|
||||||
|
}
|
||||||
|
|
||||||
|
pack_windows() {
|
||||||
|
package_name="$1"
|
||||||
|
asset_name="$2"
|
||||||
|
work_dir="$(mktemp -d)"
|
||||||
|
npm pack "${package_name}@${VERSION}" --pack-destination "${work_dir}" --json > "${work_dir}/pack.json"
|
||||||
|
tarball="${work_dir}/$(jq -r '.[0].filename' "${work_dir}/pack.json")"
|
||||||
|
tar -xzf "${tarball}" -C "${work_dir}"
|
||||||
|
zip -j "release-assets/${asset_name}.zip" "${work_dir}/package/bin/dbx.exe"
|
||||||
|
}
|
||||||
|
|
||||||
|
pack_unix "@dbx-app/cli-darwin-arm64" "dbx-cli-darwin-arm64"
|
||||||
|
pack_unix "@dbx-app/cli-darwin-x64" "dbx-cli-darwin-x64"
|
||||||
|
pack_unix "@dbx-app/cli-linux-arm64-gnu" "dbx-cli-linux-arm64-gnu"
|
||||||
|
pack_unix "@dbx-app/cli-linux-x64-gnu" "dbx-cli-linux-x64-gnu"
|
||||||
|
pack_windows "@dbx-app/cli-win32-arm64" "dbx-cli-win32-arm64"
|
||||||
|
pack_windows "@dbx-app/cli-win32-x64" "dbx-cli-win32-x64"
|
||||||
|
|
||||||
|
(
|
||||||
|
cd release-assets
|
||||||
|
sha256sum *.tar.gz *.zip > CLI-SHA256SUMS
|
||||||
|
)
|
||||||
|
|
||||||
|
- name: Attest native CLI release archives
|
||||||
|
uses: actions/attest-build-provenance@v3
|
||||||
|
with:
|
||||||
|
subject-path: release-assets/*
|
||||||
|
|
||||||
|
- name: Upload CLI assets to GitHub Release
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ needs.prepare.outputs.tag }}
|
||||||
|
run: gh release upload "${TAG}" release-assets/* --clobber
|
||||||
|
|
||||||
publish-homebrew-formula:
|
publish-homebrew-formula:
|
||||||
name: Publish Homebrew formula
|
name: Publish Homebrew formula
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -20,6 +20,18 @@ brew install dbx-cli
|
|||||||
|
|
||||||
通过 npm 安装时需要 Node.js 18.18.0 或更高版本。CLI 本身不依赖 `better-sqlite3`,也不受 Node.js native module ABI 影响。Homebrew 用户不需要单独管理 Node.js。
|
通过 npm 安装时需要 Node.js 18.18.0 或更高版本。CLI 本身不依赖 `better-sqlite3`,也不受 Node.js native module ABI 影响。Homebrew 用户不需要单独管理 Node.js。
|
||||||
|
|
||||||
|
### 独立原生版本
|
||||||
|
|
||||||
|
`packages-v*` GitHub Release 会提供适用于 macOS、Linux 和 Windows 的 CLI 原生压缩包。下载对应平台的压缩包后,使用 `CLI-SHA256SUMS` 校验,解压即可直接运行 `dbx`,不需要 Node.js。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tar -xzf dbx-cli-linux-x64-gnu.tar.gz
|
||||||
|
chmod +x dbx
|
||||||
|
./dbx --version
|
||||||
|
```
|
||||||
|
|
||||||
|
如果使用自定义或便携版 DBX 数据目录,可以设置 `DBX_DATA_DIR`。
|
||||||
|
|
||||||
查看版本:
|
查看版本:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -22,6 +22,18 @@ brew install dbx-cli
|
|||||||
|
|
||||||
Node.js 18.18.0 or newer is required for the npm launcher. The CLI itself does not depend on `better-sqlite3` or a Node.js native-module ABI. Homebrew users do not need to manage Node.js separately.
|
Node.js 18.18.0 or newer is required for the npm launcher. The CLI itself does not depend on `better-sqlite3` or a Node.js native-module ABI. Homebrew users do not need to manage Node.js separately.
|
||||||
|
|
||||||
|
### Standalone native binary
|
||||||
|
|
||||||
|
The `packages-v*` GitHub Release provides native CLI archives for macOS, Linux, and Windows. Download the archive matching your platform, verify it with `CLI-SHA256SUMS`, extract it, and run `dbx` directly. Standalone binaries do not require Node.js.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tar -xzf dbx-cli-linux-x64-gnu.tar.gz
|
||||||
|
chmod +x dbx
|
||||||
|
./dbx --version
|
||||||
|
```
|
||||||
|
|
||||||
|
Set `DBX_DATA_DIR` when using a custom or portable DBX data directory.
|
||||||
|
|
||||||
Check the installed version:
|
Check the installed version:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -19,6 +19,30 @@ brew install dbx-cli
|
|||||||
|
|
||||||
The npm package installs the native CLI for the current platform automatically. Node.js 18.18.0 or newer is only needed for the npm launcher; direct native distributions do not require Node.js.
|
The npm package installs the native CLI for the current platform automatically. Node.js 18.18.0 or newer is only needed for the npm launcher; direct native distributions do not require Node.js.
|
||||||
|
|
||||||
|
### Native downloads
|
||||||
|
|
||||||
|
The `packages-v*` GitHub Release also provides standalone native CLI archives:
|
||||||
|
|
||||||
|
| Platform | Archive |
|
||||||
|
| --- | --- |
|
||||||
|
| macOS Apple Silicon | `dbx-cli-darwin-arm64.tar.gz` |
|
||||||
|
| macOS Intel | `dbx-cli-darwin-x64.tar.gz` |
|
||||||
|
| Linux glibc ARM64 | `dbx-cli-linux-arm64-gnu.tar.gz` |
|
||||||
|
| Linux glibc x64 | `dbx-cli-linux-x64-gnu.tar.gz` |
|
||||||
|
| Windows ARM64 | `dbx-cli-win32-arm64.zip` |
|
||||||
|
| Windows x64 | `dbx-cli-win32-x64.zip` |
|
||||||
|
|
||||||
|
Verify the downloaded archive with `CLI-SHA256SUMS`, extract it, and run the native binary directly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tar -xzf dbx-cli-linux-x64-gnu.tar.gz
|
||||||
|
chmod +x dbx
|
||||||
|
./dbx --version
|
||||||
|
./dbx connections list --json
|
||||||
|
```
|
||||||
|
|
||||||
|
Standalone binaries do not require Node.js. They read the same DBX connection storage as the desktop application; set `DBX_DATA_DIR` when using a custom or portable data directory.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in new issue
Block a user