Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ jobs:
- os: ubuntu-latest
target: bun-linux-x64
output: prospec-linux-x64
archive: prospec-linux-x64.tar.gz
- os: macos-latest
target: bun-darwin-arm64
output: prospec-macos-arm64
sign: true
archive: prospec-macos-arm64.tar.gz
- os: macos-latest
target: bun-darwin-x64
output: prospec-macos-x64
sign: true
archive: prospec-macos-x64.tar.gz
- os: windows-latest
target: bun-windows-x64
output: prospec-windows-x64.exe
archive: prospec-windows-x64.zip
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
Expand Down Expand Up @@ -63,11 +67,25 @@ jobs:
if: matrix.os == 'windows-latest'
run: .\dist\${{ matrix.output }} --version

- name: Package Binary (Non-Windows)
if: matrix.os != 'windows-latest'
run: |
cp dist/${{ matrix.output }} dist/prospec
tar -czf dist/${{ matrix.archive }} -C dist prospec
rm dist/prospec

- name: Package Binary (Windows)
if: matrix.os == 'windows-latest'
run: |
Copy-Item dist\${{ matrix.output }} dist\prospec.exe
Compress-Archive -Path dist\prospec.exe -DestinationPath dist\${{ matrix.archive }}
Remove-Item dist\prospec.exe

- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.output }}
path: dist/${{ matrix.output }}
name: ${{ matrix.archive }}
path: dist/${{ matrix.archive }}

publish:
needs: build
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ powershell -c "irm https://raw.githubusercontent.com/benwu95/prospec/main/instal

Alternatively, download the precompiled binary manually from the [GitHub Releases](https://github.com/benwu95/prospec/releases) page:

- **Linux (x64)**: `prospec-linux-x64`
- **macOS (Apple Silicon)**: `prospec-macos-arm64`
- **macOS (Intel)**: `prospec-macos-x64`
- **Windows (x64)**: `prospec-windows-x64.exe`
- **Linux (x64)**: `prospec-linux-x64.tar.gz`
- **macOS (Apple Silicon)**: `prospec-macos-arm64.tar.gz`
- **macOS (Intel)**: `prospec-macos-x64.tar.gz`
- **Windows (x64)**: `prospec-windows-x64.zip`

(For manual macOS/Linux installation, run `chmod +x prospec-<os>-<arch>` and move the file to `/usr/local/bin/prospec`).
(For manual installation, extract the `prospec` or `prospec.exe` file from the archive and move it to your executable PATH).


**Option B: Run on demand with npx (Node.js environments)**
Expand Down
10 changes: 5 additions & 5 deletions README.zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ powershell -c "irm https://raw.githubusercontent.com/benwu95/prospec/main/instal

或者,您也可以手動自 [GitHub Releases](https://github.com/benwu95/prospec/releases) 頁面下載適用您平台的二進位檔:

- **Linux (x64)**: `prospec-linux-x64`
- **macOS (Apple Silicon)**: `prospec-macos-arm64`
- **macOS (Intel)**: `prospec-macos-x64`
- **Windows (x64)**: `prospec-windows-x64.exe`
- **Linux (x64)**: `prospec-linux-x64.tar.gz`
- **macOS (Apple Silicon)**: `prospec-macos-arm64.tar.gz`
- **macOS (Intel)**: `prospec-macos-x64.tar.gz`
- **Windows (x64)**: `prospec-windows-x64.zip`

手動安裝 macOS/Linux 版本時,請執行 `chmod +x prospec-<os>-<arch>` 並將檔案移動至 `/usr/local/bin/prospec`)。
手動安裝時,請自壓縮包中解壓出 `prospec` 或 `prospec.exe` 檔案,並將其移動至您的執行檔 `PATH` 目錄下)。


**選項 B:使用 npx 按需執行(Node.js 環境)**
Expand Down
24 changes: 21 additions & 3 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $ErrorActionPreference = 'Stop'

$Owner = "benwu95"
$Repo = "prospec"
$AssetName = "prospec-windows-x64.exe"
$AssetName = "prospec-windows-x64.zip"
$InstallDir = "$Home\.prospec\bin"
$TargetPath = "$InstallDir\prospec.exe"

Expand All @@ -13,15 +13,33 @@ if (-not (Test-Path $InstallDir)) {

$DownloadUrl = "https://github.com/$Owner/$Repo/releases/latest/download/$AssetName"

# Temporary path for the downloaded zip file
$TempZipPath = Join-Path $env:TEMP "prospec-windows-x64.zip"

Write-Host "Downloading $AssetName from latest release..."
try {
# Download the binary file following redirects
Invoke-WebRequest -Uri $DownloadUrl -OutFile $TargetPath -UseBasicParsing
# Download the zip file following redirects
Invoke-WebRequest -Uri $DownloadUrl -OutFile $TempZipPath -UseBasicParsing
} catch {
Write-Error "Failed to download $AssetName from $DownloadUrl"
exit 1
}

Write-Host "Extracting prospec.exe to $InstallDir..."
try {
# Extract the binary from the zip file, forcing overwrite of existing files
Expand-Archive -Path $TempZipPath -DestinationPath $InstallDir -Force
} catch {
Write-Error "Failed to extract prospec.exe from zip file"
Remove-Item $TempZipPath -ErrorAction SilentlyContinue
exit 1
} finally {
# Clean up temporary zip file
if (Test-Path $TempZipPath) {
Remove-Item $TempZipPath
}
}

Write-Host "Successfully installed prospec.exe to $TargetPath"

# Check and update PATH if not present
Expand Down
13 changes: 10 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ esac

# Determine correct asset name
if [ "${OS_NAME}" = "macos" ]; then
ASSET_NAME="prospec-macos-${ARCH_NAME}"
ASSET_NAME="prospec-macos-${ARCH_NAME}.tar.gz"
else
if [ "${ARCH_NAME}" != "x64" ]; then
echo "Unsupported Linux architecture: ${ARCH_NAME}. Only x64 is supported." >&2;
exit 1
fi
ASSET_NAME="prospec-linux-x64"
ASSET_NAME="prospec-linux-x64.tar.gz"
fi

DOWNLOAD_URL="https://github.com/${OWNER}/${REPO}/releases/latest/download/${ASSET_NAME}"
Expand All @@ -53,7 +53,14 @@ fi

# Install binary
echo "Installing to ${TARGET_PATH}..."
mv "${TEMP_FILE}" "${TARGET_PATH}"
# Extract the binary named "prospec" from the tar.gz into the INSTALL_DIR
if ! tar -xzf "${TEMP_FILE}" -C "${INSTALL_DIR}" prospec; then
echo "Error: Failed to extract binary from ${TEMP_FILE}" >&2
rm -f "${TEMP_FILE}"
exit 1
fi

rm -f "${TEMP_FILE}"
chmod +x "${TARGET_PATH}"

echo "Successfully installed prospec to ${TARGET_PATH}!"
Expand Down
2 changes: 1 addition & 1 deletion prospec/ai-knowledge/raw-scan.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ tests/

| Metric | Value |
|--------|-------|
| Total files | 395 |
| Total files | 396 |
| Scan depth | 10 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# compress-release-binaries — Archive Summary

- **Archived**: 2026-07-08
- **Original Created**: 2026-07-08T01:02:00+08:00
- **Quality Grade**: S

## User Story

As a Prospec 發行維護者,
I want 在 GitHub Release 時自動將二進位檔進行壓縮打包後再行上傳,
So that 能夠降低分發時的網路資源開銷。

As a 下游專案開發者,
I want 使用一鍵安裝腳本,讓系統自動下載適用於我平台的壓縮包並解壓安裝,
So that 我能以最少的時間與頻寬完成 prospec 的安裝。

## Affected Modules

| Module | Impact | Description |
|--------|--------|-------------|
| (none) | - | CI/CD 與安裝腳本等 Tooling 變更,不影響 TypeScript 模組原始碼。 |

## Requirements

| REQ ID | Status | Description |
|--------|--------|-------------|
| REQ-CLI-001 | MODIFIED | Standalone Binary 編譯並封裝成壓縮檔 (.zip / .tar.gz) |

## Completion

- **Tasks**: 6/6 (100%)
- **Acceptance Criteria**: 4/4

## Review & Verify

- **Review**: 1 round, 0 critical / 0 major — review-clean
- **Verify**: Grade S, Tasks PASS, Spec not-applicable, Constitution PASS, Knowledge PASS, Tests PASS; Vitest suite green (2096/2096 passed)
- **Quality Log**: no WARN/FAIL
9 changes: 5 additions & 4 deletions prospec/specs/features/standalone-binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ So that 我不需要在機器上另外安裝 Node.js 就能直接使用 prospec
- WHEN 在乾淨無 Node.js 環境的 Linux/macOS/Windows 下執行下載的 `prospec --version`,THEN 成功印出當前版本。
- WHEN 在下游專案目錄下執行 `prospec check`,THEN 可以正常進行漂移稽核並輸出稽核結果。

#### REQ-CLI-001: Standalone Binary Compilation for Multi-Platform
在 GitHub 發布 Release 時,自動觸發建置管線編譯出 Linux x64、macOS arm64/x64、Windows x64 的 Standalone Binary 獨立執行檔,並完成 macOS codesign。
#### REQ-CLI-001: Standalone Binary Compilation and Packaging for Multi-Platform
在 GitHub 發布 Release 時,自動觸發建置管線編譯出 Linux x64、macOS arm64/x64、Windows x64 的 Standalone Binary 獨立執行檔,完成 macOS codesign,並將其自動打包壓縮為 `.zip` 或 `.tar.gz` 壓縮包

**Scenarios:**
- WHEN 發布 Release 後,THEN assets 中包含 prospec-linux-x64、prospec-macos-arm64、prospec-macos-x64、prospec-windows-x64.exe
- WHEN 發布 Release 後,THEN assets 中包含 prospec-linux-x64.tar.gz、prospec-macos-arm64.tar.gz、prospec-macos-x64.tar.gz、prospec-windows-x64.zip
- WHEN 執行 macOS 二進位檔,THEN 已完成 codesign ad-hoc 簽署,能在 macOS 系統下執行。
- WHEN 執行任何二進位檔,THEN 無須外部 Node.js 執行期環境即可單獨執行。

Expand Down Expand Up @@ -91,7 +91,7 @@ So that 我不需要在機器上另外安裝 Node.js 就能直接使用 prospec

## Success Criteria

- **SC-1**: GitHub Release 的 assets 中包含 `prospec-linux-x64`、`prospec-macos-arm64`、`prospec-macos-x64`、`prospec-windows-x64.exe` 等獨立執行檔
- **SC-1**: GitHub Release 的 assets 中包含 `prospec-linux-x64.tar.gz`、`prospec-macos-arm64.tar.gz`、`prospec-macos-x64.tar.gz`、`prospec-windows-x64.zip` 等壓縮包,解壓後可直接執行
- **SC-2**: 所有二進位檔無須安裝 any 外部 Node.js 執行期環境即可正常運作。
- **SC-3**: 二進位檔支援呼叫包括 `prospec init`、`prospec check`、`prospec serve` 等現有完整指令,且範本載入運作正常。

Expand All @@ -112,3 +112,4 @@ _(None)_
|------|--------|--------|-------------|
| 2026-07-07 | compile-standalone-binary | Implement standalone binary compilation and publish pipeline | US-1, REQ-CLI-001, REQ-LIB-001, REQ-TYPES-001, REQ-DOCS-001 |
| 2026-07-08 | cli-print-template | Add print-template CLI subcommand and service to support Node.js-free template resolution in prospec-upgrade skill | US-1, REQ-CLI-020, REQ-SERVICES-015, REQ-TEMPLATES-005, REQ-LIB-008 |
| 2026-07-08 | compress-release-binaries | Package binaries in .zip and .tar.gz archives and update installers | REQ-CLI-001 |
Loading