Skip to content

Commit fa79ccc

Browse files
committed
Add extension release packaging script and release ZIP install docs
1 parent 710fb5c commit fa79ccc

2 files changed

Lines changed: 57 additions & 4 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@ Web2Comics is a Chrome extension that:
1111

1212
## Install (Easy ZIP Method)
1313

14-
### Option A: Download ZIP (recommended for non-developers)
14+
### Option A: Download Release ZIP (recommended for non-developers)
1515

16-
1. Open this repository on GitHub.
17-
2. Click `Code` -> `Download ZIP`.
16+
1. Open the repository `Releases` page on GitHub.
17+
2. Download the latest release asset ZIP (for example `Web2Comics-v1.0-extension.zip`).
1818
3. Extract the ZIP to a folder (for example `C:\Web2Comics`).
1919
4. Open Chrome and go to `chrome://extensions`.
2020
5. Turn on `Developer mode` (top-right).
2121
6. Click `Load unpacked`.
22-
7. Select the extracted `Web2Comics` folder (the folder containing `manifest.json`).
22+
7. Select the extracted folder that contains `manifest.json` (for example `Web2Comics-v1.0`).
2323
8. Web2Comics will open the Options page on first install so you can configure providers.
2424
9. (Optional) Pin the extension from Chrome’s extensions menu (Chrome does not allow extensions to pin themselves automatically).
2525

26+
Note: `Code -> Download ZIP` downloads the full source repository (tests/scripts/docs included). Use the release asset ZIP for installation.
27+
2628
### Option B: Clone the repo (developer workflow)
2729

2830
```powershell

scripts/package-release.ps1

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
param(
2+
[string]$OutputDir = ".release"
3+
)
4+
5+
$ErrorActionPreference = "Stop"
6+
7+
$manifest = Get-Content -Raw "manifest.json" | ConvertFrom-Json
8+
$version = [string]$manifest.version
9+
$packageName = "Web2Comics-v$version"
10+
$stagingRoot = Join-Path $OutputDir $packageName
11+
$zipPath = Join-Path $OutputDir "$packageName-extension.zip"
12+
13+
if (Test-Path $OutputDir) {
14+
Remove-Item $OutputDir -Recurse -Force
15+
}
16+
17+
New-Item -ItemType Directory -Path $stagingRoot | Out-Null
18+
19+
$runtimeDirs = @(
20+
"background",
21+
"content",
22+
"icons",
23+
"options",
24+
"popup",
25+
"providers",
26+
"shared",
27+
"sidepanel"
28+
)
29+
30+
foreach ($dir in $runtimeDirs) {
31+
Copy-Item $dir -Destination $stagingRoot -Recurse
32+
}
33+
34+
Copy-Item "manifest.json" -Destination $stagingRoot
35+
Copy-Item "INSTALL.md" -Destination $stagingRoot
36+
37+
$docsDir = Join-Path $stagingRoot "docs"
38+
New-Item -ItemType Directory -Path $docsDir | Out-Null
39+
Copy-Item "docs/user-manual.html" -Destination (Join-Path $docsDir "user-manual.html")
40+
41+
# Strip developer docs and optional local artifacts from the runtime folders.
42+
Get-ChildItem -Path $stagingRoot -Recurse -File -Filter "README.md" | Remove-Item -Force
43+
Get-ChildItem -Path $stagingRoot -Recurse -File -Filter "*.local.json" | Remove-Item -Force
44+
$typesPath = Join-Path $stagingRoot "shared/types.js"
45+
if (Test-Path $typesPath) {
46+
Remove-Item $typesPath -Force
47+
}
48+
49+
Compress-Archive -Path $stagingRoot -DestinationPath $zipPath -CompressionLevel Optimal -Force
50+
51+
Write-Output "Created: $zipPath"

0 commit comments

Comments
 (0)