Skip to content

Commit a31fc0c

Browse files
&mile656d696c65
authored andcommitted
fix(ci): fix CLI release workflow
- Remove redundant 'bundle' and 'build' steps (dist/index.cjs is pre-built) - Add sea-config.json for Node.js SEA binary generation - Add postject devDependency and bin/files fields to package.json - Create install.ps1 Windows installer - Update install.sh to detect platform and download correct binary - Guard upload steps with github.event_name == 'release' to prevent failures on workflow_dispatch (no upload_url available)
1 parent efab870 commit a31fc0c

5 files changed

Lines changed: 58 additions & 12 deletions

File tree

.github/workflows/cli-release.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ jobs:
4848
- name: Build metadata
4949
run: pnpm --filter @arrhes/application-metadata build
5050

51-
- name: Bundle CLI (inline all deps)
52-
working-directory: packages/cli
53-
run: pnpm bundle
54-
5551
- name: Generate SEA blob
5652
working-directory: packages/cli
5753
run: node --experimental-sea-config sea-config.json
@@ -98,6 +94,7 @@ jobs:
9894
upx --best --lzma binaries\${{ matrix.asset_name }}
9995
10096
- name: Upload binary to release
97+
if: github.event_name == 'release'
10198
uses: actions/upload-release-asset@v1
10299
env:
103100
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -109,7 +106,7 @@ jobs:
109106

110107
# Upload install scripts once (only from the Linux runner to avoid duplicates)
111108
- name: Upload install.sh to release
112-
if: runner.os == 'Linux'
109+
if: github.event_name == 'release' && runner.os == 'Linux'
113110
uses: actions/upload-release-asset@v1
114111
env:
115112
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -120,7 +117,7 @@ jobs:
120117
asset_content_type: text/plain
121118

122119
- name: Upload install.ps1 to release
123-
if: runner.os == 'Linux'
120+
if: github.event_name == 'release' && runner.os == 'Linux'
124121
uses: actions/upload-release-asset@v1
125122
env:
126123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -155,10 +152,6 @@ jobs:
155152
- name: Build metadata
156153
run: pnpm --filter @arrhes/application-metadata build
157154

158-
- name: Build CLI (tsc)
159-
working-directory: packages/cli
160-
run: pnpm build
161-
162155
- name: Set version from release tag
163156
if: github.event_name == 'release'
164157
working-directory: packages/cli

packages/cli/install.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Arrhes CLI installer for Windows
2+
# Usage: irm https://arrhes.com/cli/install.ps1 | iex
3+
$ErrorActionPreference = "Stop"
4+
5+
$REPO = "arrhes/application"
6+
$INSTALL_DIR = if ($env:ARRHES_INSTALL_DIR) { $env:ARRHES_INSTALL_DIR } else { "$env:LOCALAPPDATA\Programs\arrhes" }
7+
$DEST = "$INSTALL_DIR\arrhes.exe"
8+
9+
$URL = "https://github.com/$REPO/releases/latest/download/arrhes-windows-x64.exe"
10+
11+
Write-Host "Downloading arrhes CLI..."
12+
New-Item -ItemType Directory -Force -Path $INSTALL_DIR | Out-Null
13+
Invoke-WebRequest -Uri $URL -OutFile $DEST
14+
15+
Write-Host "Installed: $DEST"
16+
Write-Host "Version: $(& $DEST --version)"
17+
18+
# PATH hint
19+
$userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
20+
$paths = $userPath -split ";"
21+
if ($INSTALL_DIR -notin $paths) {
22+
Write-Host ""
23+
Write-Host "Add to PATH by running:"
24+
Write-Host " [Environment]::SetEnvironmentVariable('PATH', `$env:PATH + ';$INSTALL_DIR', 'User')"
25+
Write-Host "Then restart your terminal."
26+
} else {
27+
Write-Host "Run: arrhes --help"
28+
}

packages/cli/install.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@ DEST="${INSTALL_DIR}/arrhes"
99

1010
command -v curl >/dev/null 2>&1 || { echo "Error: curl is required."; exit 1; }
1111

12-
URL="https://github.com/${REPO}/releases/latest/download/arrhes.sh"
12+
# Detect platform
13+
OS="$(uname -s)"
14+
ARCH="$(uname -m)"
15+
case "${OS}-${ARCH}" in
16+
Linux-x86_64) ASSET="arrhes-linux-x64" ;;
17+
Darwin-x86_64) ASSET="arrhes-macos-x64" ;;
18+
Darwin-arm64) ASSET="arrhes-macos-arm64" ;;
19+
*) echo "Unsupported platform: ${OS}-${ARCH}"; exit 1 ;;
20+
esac
21+
22+
URL="https://github.com/${REPO}/releases/latest/download/${ASSET}"
1323

14-
echo "Downloading arrhes CLI..."
24+
echo "Downloading arrhes CLI (${ASSET})..."
1525
mkdir -p "$INSTALL_DIR"
1626
curl -fsSL --progress-bar "$URL" -o "$DEST"
1727
chmod +x "$DEST"

packages/cli/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{
22
"name": "@arrhes/cli",
33
"version": "0.1.0",
4+
"bin": {
5+
"arrhes": "dist/index.cjs"
6+
},
7+
"main": "dist/index.cjs",
8+
"files": [
9+
"dist"
10+
],
411
"publishConfig": {
512
"access": "public"
13+
},
14+
"devDependencies": {
15+
"postject": "1.0.0-alpha.6"
616
}
717
}

packages/cli/sea-config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "dist/index.cjs",
3+
"output": "sea-prep.blob",
4+
"disableExperimentalSEAWarning": true
5+
}

0 commit comments

Comments
 (0)