Skip to content

Commit 16dec0a

Browse files
committed
Add release and package publishing
1 parent 6654713 commit 16dec0a

5 files changed

Lines changed: 210 additions & 18 deletions

File tree

.github/workflows/package.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
registry-url: https://npm.pkg.github.com
26+
27+
- name: Validate package contents
28+
run: |
29+
npm run check
30+
npm pack --dry-run
31+
32+
- name: Publish package to GitHub Packages
33+
run: npm publish
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
25+
- name: Validate extension repo
26+
run: npm run check
27+
28+
- name: Build release archive
29+
shell: pwsh
30+
run: ./scripts/package-release.ps1
31+
32+
- name: Read package version
33+
id: pkg
34+
shell: bash
35+
run: echo "version=$(node -p \"require('./package.json').version\")" >> "$GITHUB_OUTPUT"
36+
37+
- name: Publish GitHub release
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
tag_name: v${{ steps.pkg.outputs.version }}
41+
name: WhiteOwl Extension v${{ steps.pkg.outputs.version }}
42+
generate_release_notes: true
43+
files: dist/whiteowl-extension-v${{ steps.pkg.outputs.version }}.zip

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,29 @@ The validator checks:
112112

113113
The bundled `lightweight-charts.js` file is intentionally excluded from the comment check because its Apache 2.0 license header must remain intact.
114114

115+
### Releases
116+
117+
Tagged versions publish a packaged browser-extension archive into GitHub Releases.
118+
119+
- Releases page: `https://github.com/whiteowl-engine/WhiteOwl-Extension/releases`
120+
- Release asset format: `whiteowl-extension-v<version>.zip`
121+
- Packaging command: `npm run package:release`
122+
123+
The release archive is built from the runtime extension files only, so it can be downloaded and loaded directly as an unpacked extension after extraction.
124+
125+
### Packages
126+
127+
This repository also publishes the source package to GitHub Packages.
128+
129+
- Package name: `@whiteowl-engine/extension`
130+
- Registry: `https://npm.pkg.github.com`
131+
132+
Preview the publish payload locally:
133+
134+
```bash
135+
npm run package:preview
136+
```
137+
115138
## Backend Integration
116139

117140
The extension is not a fully isolated product. It is a companion layer for the WhiteOwl panel.
@@ -152,20 +175,4 @@ The extension also injects content scripts and provider logic into the trading,
152175
This repository currently vendors TradingView Lightweight Charts in `lightweight-charts.js`.
153176

154177
- License: Apache License 2.0
155-
- Notice file: `THIRD_PARTY_NOTICES.md`
156-
157-
## Suggested Repository Positioning
158-
159-
Recommended GitHub description:
160-
161-
`Open-source browser extension and wallet companion for the WhiteOwl panel.`
162-
163-
Recommended topics:
164-
165-
- `whiteowl`
166-
- `chrome-extension`
167-
- `manifest-v3`
168-
- `solana`
169-
- `wallet`
170-
- `sidepanel`
171-
- `ai`
178+
- Notice file: `THIRD_PARTY_NOTICES.md`

package.json

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,57 @@
33
"version": "1.1.1",
44
"private": false,
55
"description": "Standalone WhiteOwl browser extension and wallet companion.",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/whiteowl-engine/WhiteOwl-Extension.git"
9+
},
10+
"homepage": "https://github.com/whiteowl-engine/WhiteOwl-Extension#readme",
11+
"bugs": {
12+
"url": "https://github.com/whiteowl-engine/WhiteOwl-Extension/issues"
13+
},
614
"license": "MIT",
715
"engines": {
816
"node": ">=20"
917
},
1018
"scripts": {
11-
"check": "node scripts/validate.mjs"
19+
"check": "node scripts/validate.mjs",
20+
"package:release": "powershell -ExecutionPolicy Bypass -File ./scripts/package-release.ps1",
21+
"package:preview": "npm pack --dry-run",
22+
"package:publish": "npm publish"
23+
},
24+
"files": [
25+
"_locales",
26+
"2.png",
27+
"3.png",
28+
"4.png",
29+
"5.png",
30+
"6.png",
31+
"LICENSE",
32+
"PRIVACY.md",
33+
"README.md",
34+
"SECURITY.md",
35+
"THIRD_PARTY_NOTICES.md",
36+
"background.js",
37+
"content.js",
38+
"ex.mp4",
39+
"i18n-ext.js",
40+
"icon128.png",
41+
"icon16.png",
42+
"icon48.png",
43+
"lightweight-charts.js",
44+
"logo.png",
45+
"manifest.json",
46+
"owl.svg",
47+
"provider.js",
48+
"result_transparent.webm",
49+
"screenshots",
50+
"sidepanel.css",
51+
"sidepanel.html",
52+
"sidepanel.js",
53+
"swap-progress.webm"
54+
],
55+
"publishConfig": {
56+
"registry": "https://npm.pkg.github.com"
1257
},
1358
"keywords": [
1459
"whiteowl",

scripts/package-release.ps1

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
param(
2+
[string]$Version = ""
3+
)
4+
5+
$ErrorActionPreference = 'Stop'
6+
7+
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
8+
$root = Split-Path -Parent $scriptDir
9+
10+
if (-not $Version) {
11+
$packageJson = Get-Content (Join-Path $root 'package.json') -Raw | ConvertFrom-Json
12+
$Version = $packageJson.version
13+
}
14+
15+
$distDir = Join-Path $root 'dist'
16+
$stageDir = Join-Path $distDir ('whiteowl-extension-' + $Version)
17+
$zipPath = Join-Path $distDir ('whiteowl-extension-v' + $Version + '.zip')
18+
19+
$include = @(
20+
'_locales',
21+
'2.png',
22+
'3.png',
23+
'4.png',
24+
'5.png',
25+
'6.png',
26+
'background.js',
27+
'content.js',
28+
'ex.mp4',
29+
'i18n-ext.js',
30+
'icon128.png',
31+
'icon16.png',
32+
'icon48.png',
33+
'lightweight-charts.js',
34+
'logo.png',
35+
'manifest.json',
36+
'owl.svg',
37+
'provider.js',
38+
'result_transparent.webm',
39+
'sidepanel.css',
40+
'sidepanel.html',
41+
'sidepanel.js',
42+
'swap-progress.webm'
43+
)
44+
45+
New-Item -ItemType Directory -Force -Path $distDir | Out-Null
46+
if (Test-Path $stageDir) { Remove-Item $stageDir -Recurse -Force }
47+
if (Test-Path $zipPath) { Remove-Item $zipPath -Force }
48+
New-Item -ItemType Directory -Force -Path $stageDir | Out-Null
49+
50+
foreach ($item in $include) {
51+
$source = Join-Path $root $item
52+
$target = Join-Path $stageDir $item
53+
$targetParent = Split-Path -Parent $target
54+
if (-not (Test-Path $source)) {
55+
throw "Missing release asset input: $item"
56+
}
57+
New-Item -ItemType Directory -Force -Path $targetParent | Out-Null
58+
Copy-Item $source $target -Recurse -Force
59+
}
60+
61+
Compress-Archive -Path (Join-Path $stageDir '*') -DestinationPath $zipPath -CompressionLevel Optimal
62+
Write-Output $zipPath

0 commit comments

Comments
 (0)