@akash-chowdhury-24/deployhub 1.0.1 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +228 -176
  2. package/install.ps1 +65 -55
  3. package/install.sh +99 -99
  4. package/package.json +93 -86
  5. package/src/adapters/dotnet.adapter.js +41 -41
  6. package/src/adapters/go.adapter.js +40 -40
  7. package/src/adapters/index.js +48 -48
  8. package/src/adapters/java.adapter.js +46 -46
  9. package/src/adapters/node.adapter.js +77 -77
  10. package/src/adapters/php.adapter.js +43 -43
  11. package/src/adapters/python.adapter.js +54 -54
  12. package/src/adapters/rails.adapter.js +66 -66
  13. package/src/artifact/engine.js +473 -473
  14. package/src/cli/index.js +45 -45
  15. package/src/commands/artifact.js +88 -88
  16. package/src/commands/build.js +44 -44
  17. package/src/commands/clean.js +50 -50
  18. package/src/commands/deploy.js +82 -82
  19. package/src/commands/doctor.js +630 -630
  20. package/src/commands/init.js +810 -795
  21. package/src/commands/logs.js +33 -33
  22. package/src/commands/rollback.js +50 -50
  23. package/src/commands/storage.js +116 -116
  24. package/src/commands/update.js +63 -63
  25. package/src/commands/verify.js +55 -55
  26. package/src/core/config.js +168 -168
  27. package/src/core/pipeline.js +77 -77
  28. package/src/core/stages.js +210 -210
  29. package/src/deployment/index.js +156 -156
  30. package/src/deployment/providers/azure-vm.js +7 -7
  31. package/src/deployment/providers/docker.js +30 -30
  32. package/src/deployment/providers/ec2.js +7 -7
  33. package/src/deployment/providers/gcp-vm.js +7 -7
  34. package/src/deployment/providers/kubernetes.js +30 -30
  35. package/src/deployment/providers/platforms/_shared.js +167 -167
  36. package/src/deployment/providers/platforms/aws-amplify.js +164 -164
  37. package/src/deployment/providers/platforms/azure-static-web-apps.js +68 -68
  38. package/src/deployment/providers/platforms/cloudflare-pages.js +103 -103
  39. package/src/deployment/providers/platforms/firebase-app-hosting.js +95 -95
  40. package/src/deployment/providers/platforms/firebase-hosting.js +99 -99
  41. package/src/deployment/providers/platforms/index.js +44 -44
  42. package/src/deployment/providers/platforms/netlify.js +102 -102
  43. package/src/deployment/providers/platforms/vercel.js +92 -92
  44. package/src/deployment/providers/ssh.js +365 -365
  45. package/src/detectors/angular.js +23 -23
  46. package/src/detectors/backend.detector.js +304 -304
  47. package/src/detectors/dotnet.js +18 -18
  48. package/src/detectors/frontend.detector.js +219 -219
  49. package/src/detectors/go.js +20 -20
  50. package/src/detectors/index.js +78 -78
  51. package/src/detectors/java.js +24 -24
  52. package/src/detectors/nextjs.js +23 -23
  53. package/src/detectors/node.js +28 -28
  54. package/src/detectors/php.js +17 -17
  55. package/src/detectors/python.js +22 -22
  56. package/src/detectors/react.js +29 -29
  57. package/src/detectors/vue.js +23 -23
  58. package/src/logger/index.js +44 -44
  59. package/src/notifications/email.js +53 -53
  60. package/src/notifications/index.js +34 -34
  61. package/src/notifications/slack.js +18 -18
  62. package/src/notifications/webhook.js +21 -21
  63. package/src/rollback/engine.js +102 -102
  64. package/src/storage/index.js +109 -109
  65. package/src/storage/providers/aws.js +96 -96
  66. package/src/storage/providers/azure.js +45 -45
  67. package/src/storage/providers/dropbox.js +49 -49
  68. package/src/storage/providers/ftp.js +69 -69
  69. package/src/storage/providers/gcp.js +45 -45
  70. package/src/storage/providers/gdrive.js +80 -80
  71. package/src/storage/providers/local.js +61 -61
  72. package/src/utils/author.js +154 -141
  73. package/src/utils/checksums.js +53 -53
  74. package/src/utils/firebase-config-generator.js +35 -35
  75. package/src/utils/github-actions.js +403 -403
  76. package/src/utils/init-platform.js +229 -229
  77. package/src/utils/nginx.js +34 -34
  78. package/src/utils/platform-env.js +132 -132
  79. package/src/utils/version.js +31 -31
package/README.md CHANGED
@@ -1,176 +1,228 @@
1
- # DeployHub
2
-
3
- Zero-configuration deployment and artifact manager for Node.js projects. When you push to GitHub, DeployHub automatically detects your project type, builds it, creates a versioned artifact, uploads to cloud storage, and optionally deploys to your server.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install -g @akash-chowdhury-24/deployhub
9
- ```
10
-
11
- Or use locally in your project:
12
-
13
- ```bash
14
- npm install @akash-chowdhury-24/deployhub
15
- npx @akash-chowdhury-24/deployhub init
16
- ```
17
-
18
- ## Quick Start
19
-
20
- ### 1. Initialize
21
-
22
- ```bash
23
- deployhub init
24
- ```
25
-
26
- This interactive wizard will:
27
-
28
- - Detect your framework (React, Vue, Next.js, Node, Python, etc.)
29
- - Configure build commands and output directory
30
- - Set up storage providers (AWS, Google Drive, Azure, GCP, Dropbox, Local)
31
- - Optionally configure deployment targets (SSH, Docker, EC2, Kubernetes, etc.)
32
- - Generate `deployhub.config.json`
33
- - Generate `.github/workflows/deployhub.yml`
34
- - Generate `.env.example`
35
-
36
- ### 2. Configure credentials
37
-
38
- ```bash
39
- cp .env.example .env
40
- # Edit .env with your credentials
41
-
42
- deployhub storage add aws
43
- deployhub storage add gdrive
44
- ```
45
-
46
- ### 3. Run pre-flight checks
47
-
48
- ```bash
49
- deployhub doctor
50
- ```
51
-
52
- ### 4. Deploy
53
-
54
- ```bash
55
- deployhub build
56
- ```
57
-
58
- Or push to `main` — GitHub Actions runs `deployhub build` automatically.
59
-
60
- ## Commands
61
-
62
- | Command | Description |
63
- |---------|-------------|
64
- | `deployhub init` | Interactive project setup |
65
- | `deployhub build` | Full pipeline: detect → install → test → build → artifact → storage → deploy |
66
- | `deployhub artifact create` | Create artifact from current build |
67
- | `deployhub artifact list` | List all artifacts |
68
- | `deployhub artifact restore <version>` | Download and extract an artifact |
69
- | `deployhub storage add <provider>` | Add storage provider credentials |
70
- | `deployhub storage list` | List storage providers and connection status |
71
- | `deployhub deploy` | Deploy latest artifact |
72
- | `deployhub rollback [version]` | Rollback to a previous version |
73
- | `deployhub logs` | Show logs from last deployment |
74
- | `deployhub doctor` | Pre-flight checks |
75
- | `deployhub verify` | Health check on configured endpoint |
76
- | `deployhub clean` | Remove old local artifacts |
77
- | `deployhub update` | Check for CLI updates |
78
-
79
- ## GitHub Secrets
80
-
81
- Add these secrets in your repository (Settings → Secrets and variables → Actions). Only add secrets for providers you selected during `init`:
82
-
83
- | Secret | Provider |
84
- |--------|----------|
85
- | `AWS_ACCESS_KEY_ID` | AWS S3 |
86
- | `AWS_SECRET_ACCESS_KEY` | AWS S3 |
87
- | `AWS_BUCKET` | AWS S3 |
88
- | `AWS_REGION` | AWS S3 |
89
- | `GDRIVE_CLIENT_ID` | Google Drive |
90
- | `GDRIVE_CLIENT_SECRET` | Google Drive |
91
- | `GDRIVE_REFRESH_TOKEN` | Google Drive |
92
- | `GDRIVE_FOLDER_ID` | Google Drive |
93
- | `AZURE_CONNECTION_STRING` | Azure Blob |
94
- | `AZURE_CONTAINER` | Azure Blob |
95
- | `GCP_PROJECT_ID` | GCP Storage |
96
- | `GCP_KEY_FILE` | GCP Storage |
97
- | `GCP_BUCKET` | GCP Storage |
98
- | `DROPBOX_ACCESS_TOKEN` | Dropbox |
99
- | `SSH_HOST` | SSH deployment |
100
- | `SSH_USER` | SSH deployment |
101
- | `SSH_KEY` | SSH deployment |
102
-
103
- ## `deployhub doctor` Output
104
-
105
- The doctor command runs independent checks and always completes without crashing:
106
-
107
- ```
108
- Checking Git... ✓ Git installed, repo detected, remote set
109
- Checking Docker... ✓ Docker running
110
- Checking Build command... ✓ "npm run build" found in package.json
111
- Checking AWS... ✓ Credentials valid, bucket accessible
112
- Checking Google Drive... ✓ Connected
113
- Checking SSH target... ✓ Can reach host
114
- Checking Health endpoint... ✓ URL reachable (HTTP 200)
115
- Checking Secrets... ✓ All required env vars present
116
- Checking GitHub Actions... ✓ Workflow file exists at .github/workflows/deployhub.yml
117
- Checking Storage write... ✓ Test upload succeeded
118
-
119
- Ready to deploy (10/10 checks passed)
120
- ```
121
-
122
- If checks fail:
123
-
124
- ```
125
- Checking AWS... ✗ Missing: AWS_SECRET_ACCESS_KEY
126
- Checking Health endpoint... ✗ No URL configured
127
-
128
- 8/10 fix the 2 issues above before deploying
129
- ```
130
-
131
- ## Artifact Structure
132
-
133
- Each build creates:
134
-
135
- ```
136
- artifact/
137
- {projectName}/
138
- {YYYY-MM-DD}/
139
- v{semver}/
140
- artifact.zip
141
- metadata.json
142
- logs.txt
143
- checksums.txt
144
- deployment.json
145
- release-notes.md
146
- README.md
147
- ```
148
-
149
- ## Configuration
150
-
151
- `deployhub.config.json` is generated by `init`. Credentials are **never** stored in this file — only in `.env` or GitHub Secrets.
152
-
153
- ## Pipeline Stages
154
-
155
- 1. **detect** auto-detect project type
156
- 2. **install** — install dependencies
157
- 3. **test** run test suite (skippable)
158
- 4. **build** — run build command
159
- 5. **docker** — build Docker image (skippable)
160
- 6. **artifact** create artifact.zip + metadata
161
- 7. **storage** upload to all configured providers (parallel)
162
- 8. **deploy** deploy to configured targets
163
- 9. **verify** health check after deployment
164
- 10. **notify** send Slack/email/webhook notifications
165
-
166
- ## Author
167
-
168
- **Akash Chowdhury**
169
- 📧 akashbumbac24@gmail.com
170
- 💼 [linkedin.com/in/akash-chowdhury-12141a222](https://www.linkedin.com/in/akash-chowdhury-12141a222/)
171
-
172
- Built with ❤ — if DeployHub saves you time, feel free to connect on LinkedIn.
173
-
174
- ## License
175
-
176
- MIT
1
+ # DeployHub
2
+
3
+ Zero-configuration deployment and artifact manager for Node.js projects. When you push to GitHub, DeployHub automatically detects your project type, builds it, creates a versioned artifact, uploads to cloud storage, and optionally deploys to your server.
4
+
5
+ ## Installation
6
+
7
+ DeployHub can be installed via **npm** (requires Node.js 18+) or as a **standalone binary** (no Node.js required).
8
+
9
+ ### npm (recommended for Node.js projects)
10
+
11
+ ```bash
12
+ npm install -g @akash-chowdhury-24/deployhub
13
+ ```
14
+
15
+ Or use locally in your project:
16
+
17
+ ```bash
18
+ npm install @akash-chowdhury-24/deployhub
19
+ npx deployhub init
20
+ ```
21
+
22
+ ### Standalone binary (Linux / macOS)
23
+
24
+ Downloads the latest release from [GitHub Releases](https://github.com/Akash-Chowdhury-24/DeployHub/releases) and installs to `/usr/local/bin` (or `~/.local/bin` without sudo):
25
+
26
+ ```bash
27
+ curl -fsSL https://raw.githubusercontent.com/Akash-Chowdhury-24/DeployHub/main/install.sh | sh
28
+ ```
29
+
30
+ Supported platforms: Linux x64, macOS x64, macOS ARM64. If the binary download fails, the script falls back to `npm install -g`.
31
+
32
+ ### Standalone binary (Windows)
33
+
34
+ Run in PowerShell:
35
+
36
+ ```powershell
37
+ irm https://raw.githubusercontent.com/Akash-Chowdhury-24/DeployHub/main/install.ps1 | iex
38
+ ```
39
+
40
+ Installs to `%LOCALAPPDATA%\Programs\DeployHub` and adds it to your user PATH. On Windows ARM64, the script installs via npm instead (no native binary yet).
41
+
42
+ ### Manual download
43
+
44
+ Pick the asset for your platform from the [latest release](https://github.com/Akash-Chowdhury-24/DeployHub/releases/latest):
45
+
46
+ | Platform | Asset |
47
+ |----------|-------|
48
+ | Linux x64 | `deployhub-linux-x64` |
49
+ | macOS x64 | `deployhub-macos-x64` |
50
+ | macOS ARM64 | `deployhub-macos-arm64` |
51
+ | Windows x64 | `deployhub-win.exe` |
52
+
53
+ Make it executable (Linux/macOS) and place it on your PATH:
54
+
55
+ ```bash
56
+ chmod +x deployhub-linux-x64
57
+ sudo mv deployhub-linux-x64 /usr/local/bin/deployhub
58
+ deployhub --version
59
+ ```
60
+
61
+ ### Verify installation
62
+
63
+ ```bash
64
+ deployhub --version
65
+ deployhub doctor
66
+ ```
67
+
68
+ To update an npm install: `deployhub update` or `npm install -g @akash-chowdhury-24/deployhub@latest`. For binary installs, re-run the install script or download the new release.
69
+
70
+ ## Quick Start
71
+
72
+ ### 1. Initialize
73
+
74
+ ```bash
75
+ deployhub init
76
+ ```
77
+
78
+ This interactive wizard will:
79
+
80
+ - Detect your framework (React, Vue, Next.js, Node, Python, etc.)
81
+ - Configure build commands and output directory
82
+ - Set up storage providers (AWS, Google Drive, Azure, GCP, Dropbox, Local)
83
+ - Optionally configure deployment targets (SSH, Docker, EC2, Kubernetes, etc.)
84
+ - Generate `deployhub.config.json`
85
+ - Generate `.github/workflows/deployhub.yml`
86
+ - Generate `.env.example`
87
+
88
+ ### 2. Configure credentials
89
+
90
+ ```bash
91
+ cp .env.example .env
92
+ # Edit .env with your credentials
93
+
94
+ deployhub storage add aws
95
+ deployhub storage add gdrive
96
+ ```
97
+
98
+ ### 3. Run pre-flight checks
99
+
100
+ ```bash
101
+ deployhub doctor
102
+ ```
103
+
104
+ ### 4. Deploy
105
+
106
+ ```bash
107
+ deployhub build
108
+ ```
109
+
110
+ Or push to `main` GitHub Actions runs `deployhub build` automatically.
111
+
112
+ ## Commands
113
+
114
+ | Command | Description |
115
+ |---------|-------------|
116
+ | `deployhub init` | Interactive project setup |
117
+ | `deployhub build` | Full pipeline: detect → install → test → build → artifact → storage → deploy |
118
+ | `deployhub artifact create` | Create artifact from current build |
119
+ | `deployhub artifact list` | List all artifacts |
120
+ | `deployhub artifact restore <version>` | Download and extract an artifact |
121
+ | `deployhub storage add <provider>` | Add storage provider credentials |
122
+ | `deployhub storage list` | List storage providers and connection status |
123
+ | `deployhub deploy` | Deploy latest artifact |
124
+ | `deployhub rollback [version]` | Rollback to a previous version |
125
+ | `deployhub logs` | Show logs from last deployment |
126
+ | `deployhub doctor` | Pre-flight checks |
127
+ | `deployhub verify` | Health check on configured endpoint |
128
+ | `deployhub clean` | Remove old local artifacts |
129
+ | `deployhub update` | Check for CLI updates |
130
+
131
+ ## GitHub Secrets
132
+
133
+ Add these secrets in your repository (Settings → Secrets and variables → Actions). Only add secrets for providers you selected during `init`:
134
+
135
+ | Secret | Provider |
136
+ |--------|----------|
137
+ | `AWS_ACCESS_KEY_ID` | AWS S3 |
138
+ | `AWS_SECRET_ACCESS_KEY` | AWS S3 |
139
+ | `AWS_BUCKET` | AWS S3 |
140
+ | `AWS_REGION` | AWS S3 |
141
+ | `GDRIVE_CLIENT_ID` | Google Drive |
142
+ | `GDRIVE_CLIENT_SECRET` | Google Drive |
143
+ | `GDRIVE_REFRESH_TOKEN` | Google Drive |
144
+ | `GDRIVE_FOLDER_ID` | Google Drive |
145
+ | `AZURE_CONNECTION_STRING` | Azure Blob |
146
+ | `AZURE_CONTAINER` | Azure Blob |
147
+ | `GCP_PROJECT_ID` | GCP Storage |
148
+ | `GCP_KEY_FILE` | GCP Storage |
149
+ | `GCP_BUCKET` | GCP Storage |
150
+ | `DROPBOX_ACCESS_TOKEN` | Dropbox |
151
+ | `SSH_HOST` | SSH deployment |
152
+ | `SSH_USER` | SSH deployment |
153
+ | `SSH_KEY` | SSH deployment |
154
+
155
+ ## `deployhub doctor` Output
156
+
157
+ The doctor command runs independent checks and always completes without crashing:
158
+
159
+ ```
160
+ Checking Git... ✓ Git installed, repo detected, remote set
161
+ Checking Docker... ✓ Docker running
162
+ Checking Build command... ✓ "npm run build" found in package.json
163
+ Checking AWS... ✓ Credentials valid, bucket accessible
164
+ Checking Google Drive... ✓ Connected
165
+ Checking SSH target... ✓ Can reach host
166
+ Checking Health endpoint... ✓ URL reachable (HTTP 200)
167
+ Checking Secrets... ✓ All required env vars present
168
+ Checking GitHub Actions... ✓ Workflow file exists at .github/workflows/deployhub.yml
169
+ Checking Storage write... ✓ Test upload succeeded
170
+
171
+ ✓ Ready to deploy (10/10 checks passed)
172
+ ```
173
+
174
+ If checks fail:
175
+
176
+ ```
177
+ Checking AWS... ✗ Missing: AWS_SECRET_ACCESS_KEY
178
+ Checking Health endpoint... ✗ No URL configured
179
+
180
+ 8/10 — fix the 2 issues above before deploying
181
+ ```
182
+
183
+ ## Artifact Structure
184
+
185
+ Each build creates:
186
+
187
+ ```
188
+ artifact/
189
+ {projectName}/
190
+ {YYYY-MM-DD}/
191
+ v{semver}/
192
+ artifact.zip
193
+ metadata.json
194
+ logs.txt
195
+ checksums.txt
196
+ deployment.json
197
+ release-notes.md
198
+ README.md
199
+ ```
200
+
201
+ ## Configuration
202
+
203
+ `deployhub.config.json` is generated by `init`. Credentials are **never** stored in this file — only in `.env` or GitHub Secrets.
204
+
205
+ ## Pipeline Stages
206
+
207
+ 1. **detect** — auto-detect project type
208
+ 2. **install** — install dependencies
209
+ 3. **test** — run test suite (skippable)
210
+ 4. **build** — run build command
211
+ 5. **docker** — build Docker image (skippable)
212
+ 6. **artifact** — create artifact.zip + metadata
213
+ 7. **storage** — upload to all configured providers (parallel)
214
+ 8. **deploy** — deploy to configured targets
215
+ 9. **verify** — health check after deployment
216
+ 10. **notify** — send Slack/email/webhook notifications
217
+
218
+ ## Author
219
+
220
+ **Akash Chowdhury**
221
+ 📧 akashbumbac24@gmail.com
222
+ 💼 [linkedin.com/in/akash-chowdhury-12141a222](https://www.linkedin.com/in/akash-chowdhury-12141a222/)
223
+
224
+ Built with ❤ — if DeployHub saves you time, feel free to connect on LinkedIn.
225
+
226
+ ## License
227
+
228
+ MIT
package/install.ps1 CHANGED
@@ -1,55 +1,65 @@
1
- # DeployHub install script for Windows
2
- # Author: Akash Chowdhury — canonical source: src/utils/author.js
3
- # Repository: https://github.com/Akash-Chowdhury-24/DeployHub
4
-
5
- $ErrorActionPreference = "Stop"
6
-
7
- $GitHubRepo = "Akash-Chowdhury-24/DeployHub"
8
- $BinaryName = "deployhub.exe"
9
-
10
- function Get-LatestVersion {
11
- $release = Invoke-RestMethod -Uri "https://api.github.com/repos/$GitHubRepo/releases/latest"
12
- return $release.tag_name
13
- }
14
-
15
- function Get-InstallDir {
16
- $localBin = Join-Path $env:LOCALAPPDATA "Programs\DeployHub"
17
- if (-not (Test-Path $localBin)) {
18
- New-Item -ItemType Directory -Path $localBin -Force | Out-Null
19
- }
20
- return $localBin
21
- }
22
-
23
- function Add-ToPath {
24
- param([string]$Dir)
25
- $userPath = [Environment]::GetEnvironmentVariable("Path", "User")
26
- if ($userPath -notlike "*$Dir*") {
27
- [Environment]::SetEnvironmentVariable("Path", "$userPath;$Dir", "User")
28
- $env:Path = "$env:Path;$Dir"
29
- Write-Host "Added $Dir to user PATH"
30
- }
31
- }
32
-
33
- try {
34
- $version = Get-LatestVersion
35
- $assetName = "deployhub-win.exe"
36
- $url = "https://github.com/$GitHubRepo/releases/download/$version/$assetName"
37
- $installDir = Get-InstallDir
38
- $dest = Join-Path $installDir $BinaryName
39
-
40
- Write-Host "Downloading DeployHub $version for Windows..."
41
- Invoke-WebRequest -Uri $url -OutFile $dest -UseBasicParsing
42
-
43
- if (-not (Test-Path $dest) -or (Get-Item $dest).Length -eq 0) {
44
- throw "Binary download failed"
45
- }
46
-
47
- Add-ToPath $installDir
48
- Write-Host "DeployHub $version installed to $dest"
49
- & $dest --version
50
- }
51
- catch {
52
- Write-Host "Binary install failed ($($_.Exception.Message)). Falling back to npm..." -ForegroundColor Yellow
53
- npm install -g @akash-chowdhury-24/deployhub@latest
54
- Write-Host "DeployHub installed via npm."
55
- }
1
+ # DeployHub install script for Windows
2
+ # Author: Akash Chowdhury — canonical source: src/utils/author.js
3
+ # Repository: https://github.com/Akash-Chowdhury-24/DeployHub
4
+
5
+ $ErrorActionPreference = "Stop"
6
+
7
+ $GitHubRepo = "Akash-Chowdhury-24/DeployHub"
8
+ $BinaryName = "deployhub.exe"
9
+
10
+ function Get-LatestVersion {
11
+ $release = Invoke-RestMethod -Uri "https://api.github.com/repos/$GitHubRepo/releases/latest"
12
+ return $release.tag_name
13
+ }
14
+
15
+ function Get-InstallDir {
16
+ $localBin = Join-Path $env:LOCALAPPDATA "Programs\DeployHub"
17
+ if (-not (Test-Path $localBin)) {
18
+ New-Item -ItemType Directory -Path $localBin -Force | Out-Null
19
+ }
20
+ return $localBin
21
+ }
22
+
23
+ function Add-ToPath {
24
+ param([string]$Dir)
25
+ $userPath = [Environment]::GetEnvironmentVariable("Path", "User")
26
+ if ($userPath -notlike "*$Dir*") {
27
+ [Environment]::SetEnvironmentVariable("Path", "$userPath;$Dir", "User")
28
+ $env:Path = "$env:Path;$Dir"
29
+ Write-Host "Added $Dir to user PATH"
30
+ }
31
+ }
32
+
33
+ try {
34
+ $arch = $env:PROCESSOR_ARCHITECTURE
35
+ if ($arch -eq "ARM64") {
36
+ $binaryName = "deployhub-macos-arm64" # no Windows ARM64 binary yet
37
+ Write-Host "Windows ARM64 detected — no native binary available yet. Installing via npm instead..."
38
+ npm install -g @akash-chowdhury-24/deployhub@latest
39
+ exit 0
40
+ } else {
41
+ $binaryName = "deployhub-win.exe"
42
+ }
43
+
44
+ $version = Get-LatestVersion
45
+ $assetName = $binaryName
46
+ $url = "https://github.com/$GitHubRepo/releases/download/$version/$assetName"
47
+ $installDir = Get-InstallDir
48
+ $dest = Join-Path $installDir $BinaryName
49
+
50
+ Write-Host "Downloading DeployHub $version for Windows..."
51
+ Invoke-WebRequest -Uri $url -OutFile $dest -UseBasicParsing
52
+
53
+ if (-not (Test-Path $dest) -or (Get-Item $dest).Length -eq 0) {
54
+ throw "Binary download failed"
55
+ }
56
+
57
+ Add-ToPath $installDir
58
+ Write-Host "DeployHub $version installed to $dest"
59
+ & $dest --version
60
+ }
61
+ catch {
62
+ Write-Host "Binary install failed ($($_.Exception.Message)). Falling back to npm..." -ForegroundColor Yellow
63
+ npm install -g @akash-chowdhury-24/deployhub@latest
64
+ Write-Host "DeployHub installed via npm."
65
+ }