From a31fc0c1b4cabe688691f456fd1c7d7c1771f98a Mon Sep 17 00:00:00 2001 From: &mile Date: Tue, 19 May 2026 20:01:29 +0200 Subject: [PATCH 1/3] 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) --- .github/workflows/cli-release.yml | 13 +++---------- packages/cli/install.ps1 | 28 ++++++++++++++++++++++++++++ packages/cli/install.sh | 14 ++++++++++++-- packages/cli/package.json | 10 ++++++++++ packages/cli/sea-config.json | 5 +++++ 5 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 packages/cli/install.ps1 create mode 100644 packages/cli/sea-config.json diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 79f9c308..ddd0a8b4 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -48,10 +48,6 @@ jobs: - name: Build metadata run: pnpm --filter @arrhes/application-metadata build - - name: Bundle CLI (inline all deps) - working-directory: packages/cli - run: pnpm bundle - - name: Generate SEA blob working-directory: packages/cli run: node --experimental-sea-config sea-config.json @@ -98,6 +94,7 @@ jobs: upx --best --lzma binaries\${{ matrix.asset_name }} - name: Upload binary to release + if: github.event_name == 'release' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -109,7 +106,7 @@ jobs: # Upload install scripts once (only from the Linux runner to avoid duplicates) - name: Upload install.sh to release - if: runner.os == 'Linux' + if: github.event_name == 'release' && runner.os == 'Linux' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -120,7 +117,7 @@ jobs: asset_content_type: text/plain - name: Upload install.ps1 to release - if: runner.os == 'Linux' + if: github.event_name == 'release' && runner.os == 'Linux' uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -155,10 +152,6 @@ jobs: - name: Build metadata run: pnpm --filter @arrhes/application-metadata build - - name: Build CLI (tsc) - working-directory: packages/cli - run: pnpm build - - name: Set version from release tag if: github.event_name == 'release' working-directory: packages/cli diff --git a/packages/cli/install.ps1 b/packages/cli/install.ps1 new file mode 100644 index 00000000..2602c479 --- /dev/null +++ b/packages/cli/install.ps1 @@ -0,0 +1,28 @@ +# Arrhes CLI installer for Windows +# Usage: irm https://arrhes.com/cli/install.ps1 | iex +$ErrorActionPreference = "Stop" + +$REPO = "arrhes/application" +$INSTALL_DIR = if ($env:ARRHES_INSTALL_DIR) { $env:ARRHES_INSTALL_DIR } else { "$env:LOCALAPPDATA\Programs\arrhes" } +$DEST = "$INSTALL_DIR\arrhes.exe" + +$URL = "https://github.com/$REPO/releases/latest/download/arrhes-windows-x64.exe" + +Write-Host "Downloading arrhes CLI..." +New-Item -ItemType Directory -Force -Path $INSTALL_DIR | Out-Null +Invoke-WebRequest -Uri $URL -OutFile $DEST + +Write-Host "Installed: $DEST" +Write-Host "Version: $(& $DEST --version)" + +# PATH hint +$userPath = [Environment]::GetEnvironmentVariable("PATH", "User") +$paths = $userPath -split ";" +if ($INSTALL_DIR -notin $paths) { + Write-Host "" + Write-Host "Add to PATH by running:" + Write-Host " [Environment]::SetEnvironmentVariable('PATH', `$env:PATH + ';$INSTALL_DIR', 'User')" + Write-Host "Then restart your terminal." +} else { + Write-Host "Run: arrhes --help" +} diff --git a/packages/cli/install.sh b/packages/cli/install.sh index 22fce5ec..f60e380c 100644 --- a/packages/cli/install.sh +++ b/packages/cli/install.sh @@ -9,9 +9,19 @@ DEST="${INSTALL_DIR}/arrhes" command -v curl >/dev/null 2>&1 || { echo "Error: curl is required."; exit 1; } -URL="https://github.com/${REPO}/releases/latest/download/arrhes.sh" +# Detect platform +OS="$(uname -s)" +ARCH="$(uname -m)" +case "${OS}-${ARCH}" in + Linux-x86_64) ASSET="arrhes-linux-x64" ;; + Darwin-x86_64) ASSET="arrhes-macos-x64" ;; + Darwin-arm64) ASSET="arrhes-macos-arm64" ;; + *) echo "Unsupported platform: ${OS}-${ARCH}"; exit 1 ;; +esac + +URL="https://github.com/${REPO}/releases/latest/download/${ASSET}" -echo "Downloading arrhes CLI..." +echo "Downloading arrhes CLI (${ASSET})..." mkdir -p "$INSTALL_DIR" curl -fsSL --progress-bar "$URL" -o "$DEST" chmod +x "$DEST" diff --git a/packages/cli/package.json b/packages/cli/package.json index 23e8af66..395319f1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,17 @@ { "name": "@arrhes/cli", "version": "0.1.0", + "bin": { + "arrhes": "dist/index.cjs" + }, + "main": "dist/index.cjs", + "files": [ + "dist" + ], "publishConfig": { "access": "public" + }, + "devDependencies": { + "postject": "1.0.0-alpha.6" } } diff --git a/packages/cli/sea-config.json b/packages/cli/sea-config.json new file mode 100644 index 00000000..887eb2d8 --- /dev/null +++ b/packages/cli/sea-config.json @@ -0,0 +1,5 @@ +{ + "main": "dist/index.cjs", + "output": "sea-prep.blob", + "disableExperimentalSEAWarning": true +} From 9a9ca863a776063ffe15441187d2a67c04eb7ce2 Mon Sep 17 00:00:00 2001 From: &mile Date: Tue, 19 May 2026 20:03:37 +0200 Subject: [PATCH 2/3] chore(release): v1.3.1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8b3a0227..23c38c24 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.3.0 \ No newline at end of file +v1.3.1 \ No newline at end of file From 35f6c48537fd5a59ff7845add55d72431b9a703a Mon Sep 17 00:00:00 2001 From: &mile Date: Tue, 19 May 2026 20:07:19 +0200 Subject: [PATCH 3/3] chore: update lockfile for postject dependency --- pnpm-lock.yaml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b2ac5347..1bbbd758 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,7 +85,11 @@ importers: specifier: 4.1.5 version: 4.1.5(@types/node@25.6.0)(vite@8.0.10(@types/node@25.6.0)(esbuild@0.27.7)(jiti@2.6.1)(tsx@4.21.0)) - packages/cli: {} + packages/cli: + devDependencies: + postject: + specifier: 1.0.0-alpha.6 + version: 1.0.0-alpha.6 packages/metadata: dependencies: @@ -2101,6 +2105,10 @@ packages: comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + confbox@0.2.4: resolution: {integrity: sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==} @@ -3335,6 +3343,11 @@ packages: resolution: {integrity: sha512-GD3qdB0x1z9xgFI6cdRD6xu2Sp2WCOEoe3mtnyB5Ee0XrrL5Pe+e4CCnJrRMnL1zYtRDZmQQVbvOttLnKDLnaw==} engines: {node: '>=12'} + postject@1.0.0-alpha.6: + resolution: {integrity: sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==} + engines: {node: '>=14.0.0'} + hasBin: true + prettier@3.2.5: resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} engines: {node: '>=14'} @@ -6093,6 +6106,8 @@ snapshots: comma-separated-tokens@2.0.3: {} + commander@9.5.0: {} + confbox@0.2.4: {} content-disposition@1.1.0: {} @@ -7406,6 +7421,10 @@ snapshots: postgres@3.4.9: {} + postject@1.0.0-alpha.6: + dependencies: + commander: 9.5.0 + prettier@3.2.5: {} prop-types@15.8.1: