brave-real-launcher 1.2.4 → 1.2.8
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.
- package/.github/workflows/chrome-launcher-sync.yml +354 -0
- package/GITHUB_ACTION_SETUP.md +221 -0
- package/GITHUB_SETUP.md +12 -11
- package/dist/brave-finder.js +5 -5
- package/dist/brave-finder.mjs +2 -2
- package/dist/brave-launcher.js +22 -22
- package/dist/brave-launcher.mjs +2 -2
- package/dist/chrome-launcher.js +21 -21
- package/dist/chrome-launcher.mjs +2 -2
- package/dist/logger.d.ts +31 -0
- package/dist/logger.js +75 -0
- package/dist/logger.mjs +73 -0
- package/dist/utils.js +7 -7
- package/dist/utils.mjs +2 -2
- package/dist/xvfb-support.js +11 -11
- package/dist/xvfb-support.mjs +2 -2
- package/package.json +6 -3
- package/scripts/chrome-launcher-sync.cjs +434 -0
- package/scripts/cleanup-duplicates.cjs +114 -0
- package/scripts/version-increment.cjs +313 -0
- package/test-workflow-local.js +253 -0
- package/workflow-test-report.md +44 -0
- package/.github/workflows/main.yml +0 -426
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
name: Chrome Launcher Sync & Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# Automatic triggers
|
|
5
|
+
schedule:
|
|
6
|
+
# Weekly trigger (minimum requirement) - Every Monday at 6 AM UTC
|
|
7
|
+
- cron: '0 6 * * 1' # Weekly Monday at 6 AM UTC (11:30 AM IST)
|
|
8
|
+
# Daily trigger (for frequent updates) - Every day at 6 AM UTC
|
|
9
|
+
- cron: '0 6 * * *' # Daily at 6 AM UTC (11:30 AM IST)
|
|
10
|
+
|
|
11
|
+
# Manual trigger
|
|
12
|
+
workflow_dispatch:
|
|
13
|
+
inputs:
|
|
14
|
+
chrome_launcher_version:
|
|
15
|
+
description: 'Chrome-launcher version to sync (leave empty for latest)'
|
|
16
|
+
required: false
|
|
17
|
+
default: 'latest'
|
|
18
|
+
force_publish:
|
|
19
|
+
description: 'Force publish even if no updates'
|
|
20
|
+
type: boolean
|
|
21
|
+
default: false
|
|
22
|
+
skip_tests:
|
|
23
|
+
description: 'Skip tests (use carefully)'
|
|
24
|
+
type: boolean
|
|
25
|
+
default: false
|
|
26
|
+
|
|
27
|
+
# Trigger on push to main (for testing)
|
|
28
|
+
push:
|
|
29
|
+
branches: [ main, master ]
|
|
30
|
+
paths:
|
|
31
|
+
- 'scripts/chrome-launcher-sync.cjs'
|
|
32
|
+
- '.github/workflows/chrome-launcher-sync.yml'
|
|
33
|
+
|
|
34
|
+
env:
|
|
35
|
+
NODE_VERSION: '18'
|
|
36
|
+
REGISTRY_URL: 'https://registry.npmjs.org'
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
check-updates:
|
|
40
|
+
name: Check for Chrome-launcher Updates
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
outputs:
|
|
43
|
+
has_updates: ${{ steps.check.outputs.has_updates }}
|
|
44
|
+
chrome_version: ${{ steps.check.outputs.chrome_version }}
|
|
45
|
+
current_version: ${{ steps.check.outputs.current_version }}
|
|
46
|
+
should_proceed: ${{ steps.check.outputs.should_proceed }}
|
|
47
|
+
|
|
48
|
+
steps:
|
|
49
|
+
- name: Checkout Repository
|
|
50
|
+
uses: actions/checkout@v4
|
|
51
|
+
with:
|
|
52
|
+
fetch-depth: 0
|
|
53
|
+
|
|
54
|
+
- name: Setup Node.js
|
|
55
|
+
uses: actions/setup-node@v4
|
|
56
|
+
with:
|
|
57
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
58
|
+
cache: 'npm'
|
|
59
|
+
|
|
60
|
+
- name: Install Dependencies
|
|
61
|
+
run: npm ci
|
|
62
|
+
|
|
63
|
+
- name: Check Chrome-launcher Updates & Version Management
|
|
64
|
+
id: check
|
|
65
|
+
run: |
|
|
66
|
+
echo "🔍 Checking for chrome-launcher updates and version management..."
|
|
67
|
+
|
|
68
|
+
# Get current version from package.json
|
|
69
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
70
|
+
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
|
71
|
+
echo "Current brave-real-launcher version: $CURRENT_VERSION"
|
|
72
|
+
|
|
73
|
+
# Get latest chrome-launcher version
|
|
74
|
+
if [ "${{ github.event.inputs.chrome_launcher_version }}" = "latest" ] || [ -z "${{ github.event.inputs.chrome_launcher_version }}" ]; then
|
|
75
|
+
# Get latest chrome-launcher version from npm
|
|
76
|
+
CHROME_VERSION=$(npm view chrome-launcher version)
|
|
77
|
+
echo "chrome_version=$CHROME_VERSION" >> $GITHUB_OUTPUT
|
|
78
|
+
echo "Latest chrome-launcher version: $CHROME_VERSION"
|
|
79
|
+
else
|
|
80
|
+
CHROME_VERSION="${{ github.event.inputs.chrome_launcher_version }}"
|
|
81
|
+
echo "chrome_version=$CHROME_VERSION" >> $GITHUB_OUTPUT
|
|
82
|
+
echo "Target chrome-launcher version: $CHROME_VERSION"
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
# Smart version increment logic - ALWAYS proceed for continuous updates
|
|
86
|
+
FORCE_PUBLISH="${{ github.event.inputs.force_publish }}"
|
|
87
|
+
|
|
88
|
+
# Use version increment utility to determine if we should proceed
|
|
89
|
+
echo "📦 Running version increment analysis..."
|
|
90
|
+
node scripts/version-increment.cjs --dry-run --force
|
|
91
|
+
|
|
92
|
+
# We always proceed now for continuous integration
|
|
93
|
+
echo "has_updates=true" >> $GITHUB_OUTPUT
|
|
94
|
+
echo "should_proceed=true" >> $GITHUB_OUTPUT
|
|
95
|
+
|
|
96
|
+
if [ "$CURRENT_VERSION" != "$CHROME_VERSION" ]; then
|
|
97
|
+
echo "✅ Chrome-launcher version sync available: $CURRENT_VERSION → $CHROME_VERSION"
|
|
98
|
+
else
|
|
99
|
+
echo "📈 Auto-increment for continuous updates: $CURRENT_VERSION → $CURRENT_VERSION+1"
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
echo "🚀 Proceeding with sync and version increment"
|
|
103
|
+
|
|
104
|
+
sync-and-build:
|
|
105
|
+
name: Sync Chrome-launcher & Build
|
|
106
|
+
runs-on: ubuntu-latest
|
|
107
|
+
needs: check-updates
|
|
108
|
+
# Always run for continuous version updates
|
|
109
|
+
if: always() && needs.check-updates.outputs.should_proceed == 'true'
|
|
110
|
+
|
|
111
|
+
outputs:
|
|
112
|
+
build_success: ${{ steps.build.outputs.success }}
|
|
113
|
+
new_version: ${{ steps.sync.outputs.new_version }}
|
|
114
|
+
|
|
115
|
+
steps:
|
|
116
|
+
- name: Checkout Repository
|
|
117
|
+
uses: actions/checkout@v4
|
|
118
|
+
with:
|
|
119
|
+
fetch-depth: 0
|
|
120
|
+
token: ${{ secrets.GH_TOKEN }}
|
|
121
|
+
|
|
122
|
+
- name: Setup Node.js
|
|
123
|
+
uses: actions/setup-node@v4
|
|
124
|
+
with:
|
|
125
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
126
|
+
cache: 'npm'
|
|
127
|
+
registry-url: ${{ env.REGISTRY_URL }}
|
|
128
|
+
|
|
129
|
+
- name: Configure Git
|
|
130
|
+
run: |
|
|
131
|
+
git config --global user.name "github-actions[bot]"
|
|
132
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
133
|
+
|
|
134
|
+
- name: Install Dependencies
|
|
135
|
+
run: npm ci
|
|
136
|
+
|
|
137
|
+
- name: Clean up duplicate chrome files
|
|
138
|
+
run: |
|
|
139
|
+
echo "🧹 Cleaning up any duplicate chrome files..."
|
|
140
|
+
node scripts/cleanup-duplicates.cjs
|
|
141
|
+
echo "✅ Pre-sync cleanup completed"
|
|
142
|
+
|
|
143
|
+
- name: Smart Version Increment
|
|
144
|
+
id: sync
|
|
145
|
+
run: |
|
|
146
|
+
echo "📈 Starting smart version increment..."
|
|
147
|
+
|
|
148
|
+
OLD_VERSION="${{ needs.check-updates.outputs.current_version }}"
|
|
149
|
+
echo "Current version: $OLD_VERSION"
|
|
150
|
+
|
|
151
|
+
# Use version increment utility directly (more reliable)
|
|
152
|
+
echo "📦 Running version increment..."
|
|
153
|
+
node scripts/version-increment.cjs --force
|
|
154
|
+
|
|
155
|
+
# Get the new version from package.json (after increment)
|
|
156
|
+
NEW_VERSION=$(node -p "require('./package.json').version")
|
|
157
|
+
|
|
158
|
+
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
159
|
+
echo "old_version=$OLD_VERSION" >> $GITHUB_OUTPUT
|
|
160
|
+
|
|
161
|
+
echo "✅ Version increment completed: $OLD_VERSION → $NEW_VERSION"
|
|
162
|
+
|
|
163
|
+
# Check if version was incremented
|
|
164
|
+
if [ "$OLD_VERSION" != "$NEW_VERSION" ]; then
|
|
165
|
+
echo "📈 Version successfully incremented!"
|
|
166
|
+
echo "version_incremented=true" >> $GITHUB_OUTPUT
|
|
167
|
+
else
|
|
168
|
+
echo "ℹ️ Version remained the same"
|
|
169
|
+
echo "version_incremented=false" >> $GITHUB_OUTPUT
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
- name: Install Updated Dependencies
|
|
173
|
+
run: |
|
|
174
|
+
echo "📦 Installing updated dependencies..."
|
|
175
|
+
npm install
|
|
176
|
+
|
|
177
|
+
- name: Build Project
|
|
178
|
+
id: build
|
|
179
|
+
run: |
|
|
180
|
+
echo "🔨 Building project..."
|
|
181
|
+
npm run build
|
|
182
|
+
echo "success=true" >> $GITHUB_OUTPUT
|
|
183
|
+
echo "✅ Build completed successfully"
|
|
184
|
+
|
|
185
|
+
- name: Run Tests
|
|
186
|
+
if: github.event.inputs.skip_tests != 'true'
|
|
187
|
+
run: |
|
|
188
|
+
echo "🧪 Running tests..."
|
|
189
|
+
npm run test:ci
|
|
190
|
+
echo "✅ All tests passed"
|
|
191
|
+
|
|
192
|
+
- name: Verify Build Output
|
|
193
|
+
run: |
|
|
194
|
+
echo "🔍 Verifying build outputs..."
|
|
195
|
+
ls -la dist/
|
|
196
|
+
node -e "console.log('✅ Build verification:', require('./dist/index.js') ? 'Success' : 'Failed')"
|
|
197
|
+
|
|
198
|
+
- name: Commit Changes
|
|
199
|
+
run: |
|
|
200
|
+
if git diff --quiet; then
|
|
201
|
+
echo "No changes to commit"
|
|
202
|
+
else
|
|
203
|
+
git add .
|
|
204
|
+
git commit -m "chore: auto-increment version v${{ steps.sync.outputs.new_version }}
|
|
205
|
+
|
|
206
|
+
- Version increment: ${{ steps.sync.outputs.old_version }} → ${{ steps.sync.outputs.new_version }}
|
|
207
|
+
- Chrome-launcher reference: v${{ needs.check-updates.outputs.chrome_version }}
|
|
208
|
+
- Build system: ✅ All tests passing
|
|
209
|
+
- Dependencies: ✅ Up to date
|
|
210
|
+
- Features: ✅ All Brave-specific features preserved
|
|
211
|
+
- Continuous updates: ✅ Smart increment logic
|
|
212
|
+
|
|
213
|
+
Auto-generated by GitHub Actions"
|
|
214
|
+
|
|
215
|
+
git push origin ${{ github.ref_name }}
|
|
216
|
+
echo "✅ Changes committed and pushed"
|
|
217
|
+
fi
|
|
218
|
+
|
|
219
|
+
publish-npm:
|
|
220
|
+
name: Publish to NPM
|
|
221
|
+
runs-on: ubuntu-latest
|
|
222
|
+
needs: [check-updates, sync-and-build]
|
|
223
|
+
if: needs.sync-and-build.outputs.build_success == 'true'
|
|
224
|
+
|
|
225
|
+
steps:
|
|
226
|
+
- name: Checkout Repository
|
|
227
|
+
uses: actions/checkout@v4
|
|
228
|
+
with:
|
|
229
|
+
ref: ${{ github.ref_name }}
|
|
230
|
+
token: ${{ secrets.GH_TOKEN }}
|
|
231
|
+
|
|
232
|
+
- name: Setup Node.js
|
|
233
|
+
uses: actions/setup-node@v4
|
|
234
|
+
with:
|
|
235
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
236
|
+
cache: 'npm'
|
|
237
|
+
registry-url: ${{ env.REGISTRY_URL }}
|
|
238
|
+
|
|
239
|
+
- name: Install Dependencies
|
|
240
|
+
run: npm ci
|
|
241
|
+
|
|
242
|
+
- name: Build for Publication
|
|
243
|
+
run: |
|
|
244
|
+
echo "🔨 Building for publication..."
|
|
245
|
+
npm run build
|
|
246
|
+
echo "✅ Build completed"
|
|
247
|
+
|
|
248
|
+
- name: Final Tests Before Publish
|
|
249
|
+
if: github.event.inputs.skip_tests != 'true'
|
|
250
|
+
run: |
|
|
251
|
+
echo "🧪 Running final tests..."
|
|
252
|
+
npm run test:ci
|
|
253
|
+
echo "✅ All tests passed"
|
|
254
|
+
|
|
255
|
+
- name: Check NPM Authentication
|
|
256
|
+
run: |
|
|
257
|
+
echo "🔐 Checking NPM authentication..."
|
|
258
|
+
npm whoami
|
|
259
|
+
env:
|
|
260
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
261
|
+
|
|
262
|
+
- name: Publish to NPM
|
|
263
|
+
run: |
|
|
264
|
+
echo "📦 Publishing to NPM..."
|
|
265
|
+
|
|
266
|
+
# Get package info
|
|
267
|
+
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
268
|
+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
269
|
+
|
|
270
|
+
echo "Publishing $PACKAGE_NAME@$PACKAGE_VERSION"
|
|
271
|
+
|
|
272
|
+
# Publish with retry logic
|
|
273
|
+
npm publish --access public
|
|
274
|
+
|
|
275
|
+
echo "✅ Successfully published $PACKAGE_NAME@$PACKAGE_VERSION"
|
|
276
|
+
env:
|
|
277
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
278
|
+
|
|
279
|
+
- name: Create GitHub Release
|
|
280
|
+
uses: actions/create-release@v1
|
|
281
|
+
env:
|
|
282
|
+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
283
|
+
with:
|
|
284
|
+
tag_name: v${{ needs.sync-and-build.outputs.new_version }}
|
|
285
|
+
release_name: Release v${{ needs.sync-and-build.outputs.new_version }}
|
|
286
|
+
body: |
|
|
287
|
+
## 🚀 Chrome-launcher Sync Update
|
|
288
|
+
|
|
289
|
+
This release automatically syncs with **chrome-launcher v${{ needs.check-updates.outputs.chrome_version }}**
|
|
290
|
+
|
|
291
|
+
### ✨ What's Updated
|
|
292
|
+
- 🔄 Synced with chrome-launcher v${{ needs.check-updates.outputs.chrome_version }}
|
|
293
|
+
- 🦁 All Brave-specific features preserved and enhanced
|
|
294
|
+
- 📦 Dependencies updated to latest versions
|
|
295
|
+
- 🧪 All tests passing
|
|
296
|
+
- 🔨 Build system updated
|
|
297
|
+
|
|
298
|
+
### 📋 Sync Details
|
|
299
|
+
- **Previous version:** ${{ needs.check-updates.outputs.current_version }}
|
|
300
|
+
- **New version:** ${{ needs.sync-and-build.outputs.new_version }}
|
|
301
|
+
- **Chrome-launcher version:** ${{ needs.check-updates.outputs.chrome_version }}
|
|
302
|
+
- **Auto-published:** ✅ Available on NPM
|
|
303
|
+
|
|
304
|
+
### 🔗 Links
|
|
305
|
+
- [NPM Package](https://www.npmjs.com/package/brave-real-launcher)
|
|
306
|
+
- [Chrome-launcher Repository](https://github.com/GoogleChrome/chrome-launcher)
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
*This release was automatically generated by GitHub Actions*
|
|
310
|
+
draft: false
|
|
311
|
+
prerelease: false
|
|
312
|
+
|
|
313
|
+
notify-completion:
|
|
314
|
+
name: Notify Completion
|
|
315
|
+
runs-on: ubuntu-latest
|
|
316
|
+
needs: [check-updates, sync-and-build, publish-npm]
|
|
317
|
+
if: always()
|
|
318
|
+
|
|
319
|
+
steps:
|
|
320
|
+
- name: Workflow Summary
|
|
321
|
+
run: |
|
|
322
|
+
echo "## 🎯 Workflow Summary" >> $GITHUB_STEP_SUMMARY
|
|
323
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
324
|
+
|
|
325
|
+
if [ "${{ needs.check-updates.outputs.should_proceed }}" = "true" ]; then
|
|
326
|
+
echo "### ✅ Updates Processed" >> $GITHUB_STEP_SUMMARY
|
|
327
|
+
echo "- **Chrome-launcher version:** ${{ needs.check-updates.outputs.chrome_version }}" >> $GITHUB_STEP_SUMMARY
|
|
328
|
+
echo "- **Previous version:** ${{ needs.check-updates.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY
|
|
329
|
+
echo "- **New version:** ${{ needs.sync-and-build.outputs.new_version }}" >> $GITHUB_STEP_SUMMARY
|
|
330
|
+
|
|
331
|
+
if [ "${{ needs.sync-and-build.result }}" = "success" ]; then
|
|
332
|
+
echo "- **Sync & Build:** ✅ Success" >> $GITHUB_STEP_SUMMARY
|
|
333
|
+
else
|
|
334
|
+
echo "- **Sync & Build:** ❌ Failed" >> $GITHUB_STEP_SUMMARY
|
|
335
|
+
fi
|
|
336
|
+
|
|
337
|
+
if [ "${{ needs.publish-npm.result }}" = "success" ]; then
|
|
338
|
+
echo "- **NPM Publish:** ✅ Success" >> $GITHUB_STEP_SUMMARY
|
|
339
|
+
echo "- **Package URL:** https://www.npmjs.com/package/brave-real-launcher" >> $GITHUB_STEP_SUMMARY
|
|
340
|
+
else
|
|
341
|
+
echo "- **NPM Publish:** ❌ Failed" >> $GITHUB_STEP_SUMMARY
|
|
342
|
+
fi
|
|
343
|
+
else
|
|
344
|
+
echo "### ℹ️ No Updates Required" >> $GITHUB_STEP_SUMMARY
|
|
345
|
+
echo "- Current version is already up-to-date with chrome-launcher" >> $GITHUB_STEP_SUMMARY
|
|
346
|
+
echo "- **Current version:** ${{ needs.check-updates.outputs.current_version }}" >> $GITHUB_STEP_SUMMARY
|
|
347
|
+
echo "- **Chrome-launcher version:** ${{ needs.check-updates.outputs.chrome_version }}" >> $GITHUB_STEP_SUMMARY
|
|
348
|
+
fi
|
|
349
|
+
|
|
350
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
351
|
+
echo "### 🔗 Useful Links" >> $GITHUB_STEP_SUMMARY
|
|
352
|
+
echo "- [Repository](https://github.com/${{ github.repository }})" >> $GITHUB_STEP_SUMMARY
|
|
353
|
+
echo "- [NPM Package](https://www.npmjs.com/package/brave-real-launcher)" >> $GITHUB_STEP_SUMMARY
|
|
354
|
+
echo "- [Chrome-launcher](https://github.com/GoogleChrome/chrome-launcher)" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# GitHub Action Setup Guide
|
|
2
|
+
|
|
3
|
+
यह guide आपको brave-real-launcher के लिए GitHub Action workflow setup करने में मदद करेगी।
|
|
4
|
+
|
|
5
|
+
## 🔑 Required GitHub Secrets
|
|
6
|
+
|
|
7
|
+
GitHub repository में निम्नलिखित secrets configure करना आवश्यक है:
|
|
8
|
+
|
|
9
|
+
### 1. GH_TOKEN (GitHub Personal Access Token)
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# GitHub Personal Access Token with these permissions:
|
|
13
|
+
- repo (Full control of private repositories)
|
|
14
|
+
- workflow (Update GitHub Action workflows)
|
|
15
|
+
- write:packages (Write packages to GitHub Package Registry)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**कैसे बनाएं:**
|
|
19
|
+
1. GitHub.com पर जाएं → Settings → Developer settings → Personal access tokens
|
|
20
|
+
2. "Generate new token (classic)" पर click करें
|
|
21
|
+
3. ऊपर दिए गए permissions select करें
|
|
22
|
+
4. Token generate करें और copy करें
|
|
23
|
+
|
|
24
|
+
### 2. NPM_TOKEN (NPM Authentication Token)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# NPM Token with publish permissions
|
|
28
|
+
- Type: Automation token (recommended)
|
|
29
|
+
- Scope: brave-real-launcher package
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**कैसे बनाएं:**
|
|
33
|
+
1. NPM.js पर login करें → Account Settings → Access Tokens
|
|
34
|
+
2. "Generate New Token" → "Automation" select करें
|
|
35
|
+
3. Token generate करें और copy करें
|
|
36
|
+
|
|
37
|
+
## 📝 Secrets Configuration
|
|
38
|
+
|
|
39
|
+
GitHub repository में secrets add करें:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Repository में जाएं
|
|
43
|
+
Settings → Secrets and variables → Actions → New repository secret
|
|
44
|
+
|
|
45
|
+
# Add करें:
|
|
46
|
+
Name: GH_TOKEN
|
|
47
|
+
Value: {{your_github_token}}
|
|
48
|
+
|
|
49
|
+
Name: NPM_TOKEN
|
|
50
|
+
Value: {{your_npm_token}}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 🚀 Workflow Features
|
|
54
|
+
|
|
55
|
+
### 📈 Auto-increment Version Logic
|
|
56
|
+
- **Smart Versioning**: हमेशा version increment होता है (1.2.0 → 1.2.1 → 1.2.2...)
|
|
57
|
+
- **Chrome-launcher Sync**: Chrome-launcher के version के साथ intelligent sync
|
|
58
|
+
- **Continuous Updates**: जब chrome-launcher version same हो तब भी patch increment
|
|
59
|
+
- **Strategy Support**: Major, Minor, Patch, और Auto increment strategies
|
|
60
|
+
|
|
61
|
+
### Automatic Triggers
|
|
62
|
+
- **Daily Check**: हर रोज सुबह 6 बजे UTC (11:30 AM IST)
|
|
63
|
+
- **Push Trigger**: scripts या workflow files में changes पर
|
|
64
|
+
- **Always Proceeds**: अब workflow हमेशा run होगी continuous updates के लिए
|
|
65
|
+
|
|
66
|
+
### Manual Triggers
|
|
67
|
+
```bash
|
|
68
|
+
# GitHub UI से:
|
|
69
|
+
Actions → Chrome Launcher Sync & Publish → Run workflow
|
|
70
|
+
|
|
71
|
+
# GitHub CLI से:
|
|
72
|
+
gh workflow run chrome-launcher-sync.yml
|
|
73
|
+
|
|
74
|
+
# Custom parameters के साथ:
|
|
75
|
+
gh workflow run chrome-launcher-sync.yml \
|
|
76
|
+
-f chrome_launcher_version=1.2.0 \
|
|
77
|
+
-f force_publish=true \
|
|
78
|
+
-f skip_tests=false
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 📋 Workflow Jobs
|
|
82
|
+
|
|
83
|
+
### 1. check-updates
|
|
84
|
+
- chrome-launcher के latest version को check करता है
|
|
85
|
+
- Current version से compare करता है
|
|
86
|
+
- Update available है तो आगे proceed करता है
|
|
87
|
+
|
|
88
|
+
### 2. sync-and-build
|
|
89
|
+
- Chrome-launcher को sync करता है
|
|
90
|
+
- Brave-specific features preserve करता है
|
|
91
|
+
- Project को build करता है
|
|
92
|
+
- Tests run करता है
|
|
93
|
+
- Changes को commit करता है
|
|
94
|
+
|
|
95
|
+
### 3. publish-npm
|
|
96
|
+
- NPM पर package publish करता है
|
|
97
|
+
- GitHub release create करता है
|
|
98
|
+
- Version tags add करता है
|
|
99
|
+
|
|
100
|
+
### 4. notify-completion
|
|
101
|
+
- Workflow summary generate करता है
|
|
102
|
+
- Success/failure status report करता है
|
|
103
|
+
|
|
104
|
+
## 🔧 Local Testing
|
|
105
|
+
|
|
106
|
+
Workflow को push करने से पहले local testing कर सकते हैं:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Local validation script run करें
|
|
110
|
+
node test-workflow-local.js
|
|
111
|
+
|
|
112
|
+
# Version increment test करें
|
|
113
|
+
node scripts/version-increment.cjs --dry-run
|
|
114
|
+
node scripts/version-increment.cjs --dry-run --force
|
|
115
|
+
node scripts/version-increment.cjs --dry-run --strategy=patch
|
|
116
|
+
|
|
117
|
+
# Actually increment version
|
|
118
|
+
node scripts/version-increment.cjs --force
|
|
119
|
+
|
|
120
|
+
# Sync script manually test करें
|
|
121
|
+
node scripts/chrome-launcher-sync.cjs latest
|
|
122
|
+
|
|
123
|
+
# Build process test करें
|
|
124
|
+
npm run build
|
|
125
|
+
npm run test:ci
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 🎯 Manual Workflow Execution
|
|
129
|
+
|
|
130
|
+
### Basic Run
|
|
131
|
+
```bash
|
|
132
|
+
# Default settings के साथ
|
|
133
|
+
gh workflow run chrome-launcher-sync.yml
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Advanced Run
|
|
137
|
+
```bash
|
|
138
|
+
# Specific version target करें
|
|
139
|
+
gh workflow run chrome-launcher-sync.yml \
|
|
140
|
+
-f chrome_launcher_version=1.1.0
|
|
141
|
+
|
|
142
|
+
# Force publish करें
|
|
143
|
+
gh workflow run chrome-launcher-sync.yml \
|
|
144
|
+
-f force_publish=true
|
|
145
|
+
|
|
146
|
+
# Tests skip करें (careful!)
|
|
147
|
+
gh workflow run chrome-launcher-sync.yml \
|
|
148
|
+
-f skip_tests=true
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## 📊 Monitoring
|
|
152
|
+
|
|
153
|
+
### Workflow Status Check
|
|
154
|
+
```bash
|
|
155
|
+
# Recent workflow runs देखें
|
|
156
|
+
gh run list
|
|
157
|
+
|
|
158
|
+
# Specific run details
|
|
159
|
+
gh run view <run-id>
|
|
160
|
+
|
|
161
|
+
# Logs देखें
|
|
162
|
+
gh run view <run-id> --log
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### NPM Package Verification
|
|
166
|
+
```bash
|
|
167
|
+
# Published version check करें
|
|
168
|
+
npm view brave-real-launcher version
|
|
169
|
+
|
|
170
|
+
# Package info देखें
|
|
171
|
+
npm info brave-real-launcher
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 🚨 Troubleshooting
|
|
175
|
+
|
|
176
|
+
### Common Issues
|
|
177
|
+
|
|
178
|
+
#### 1. GH_TOKEN Permission Error
|
|
179
|
+
```
|
|
180
|
+
Error: Resource not accessible by integration
|
|
181
|
+
```
|
|
182
|
+
**Solution:** GH_TOKEN में `repo` और `workflow` permissions check करें
|
|
183
|
+
|
|
184
|
+
#### 2. NPM_TOKEN Authentication Error
|
|
185
|
+
```
|
|
186
|
+
Error: Unable to authenticate with npm
|
|
187
|
+
```
|
|
188
|
+
**Solution:** NPM_TOKEN valid है और `automation` type का है verify करें
|
|
189
|
+
|
|
190
|
+
#### 3. Build Failures
|
|
191
|
+
```
|
|
192
|
+
Error: TypeScript compilation failed
|
|
193
|
+
```
|
|
194
|
+
**Solution:** Local build test करें और dependencies update करें
|
|
195
|
+
|
|
196
|
+
#### 4. Sync Script Failures
|
|
197
|
+
```
|
|
198
|
+
Error: Chrome-launcher sync failed
|
|
199
|
+
```
|
|
200
|
+
**Solution:** Internet connection check करें और git access verify करें
|
|
201
|
+
|
|
202
|
+
## 📈 Success Metrics
|
|
203
|
+
|
|
204
|
+
Workflow successfully run होने पर:
|
|
205
|
+
- ✅ brave-real-launcher npm पर published
|
|
206
|
+
- ✅ GitHub release created
|
|
207
|
+
- ✅ Version tags updated
|
|
208
|
+
- ✅ All Brave features preserved
|
|
209
|
+
- ✅ Tests passing
|
|
210
|
+
- ✅ Documentation updated
|
|
211
|
+
|
|
212
|
+
## 🔗 Useful Links
|
|
213
|
+
|
|
214
|
+
- [GitHub Actions Documentation](https://docs.github.com/en/actions)
|
|
215
|
+
- [NPM Publishing Guide](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry)
|
|
216
|
+
- [Chrome-launcher Repository](https://github.com/GoogleChrome/chrome-launcher)
|
|
217
|
+
- [Brave-real-launcher NPM](https://www.npmjs.com/package/brave-real-launcher)
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
**Next Step:** Push करने से पहले सुनिश्चित करें कि GitHub secrets properly configured हैं।
|
package/GITHUB_SETUP.md
CHANGED
|
@@ -43,7 +43,7 @@ Repository में changes commit करने के लिए:
|
|
|
43
43
|
- Name: `GH_TOKEN`
|
|
44
44
|
- Value: आपका personal access token
|
|
45
45
|
|
|
46
|
-
## 🚀 Workflow Triggers
|
|
46
|
+
## 🚀 Simple Workflow Triggers
|
|
47
47
|
|
|
48
48
|
### 1. ऑटोमेटिक Triggers
|
|
49
49
|
```yaml
|
|
@@ -56,9 +56,9 @@ schedule:
|
|
|
56
56
|
Repository पर जाकर:
|
|
57
57
|
1. Actions tab → "Brave Real Launcher - Auto Sync & Publish"
|
|
58
58
|
2. "Run workflow" button click करें
|
|
59
|
-
3. Options
|
|
60
|
-
- **Sync
|
|
61
|
-
- **
|
|
59
|
+
3. Simple Options:
|
|
60
|
+
- **Force Sync**: जबरदस्ती chrome-launcher sync करें
|
|
61
|
+
- **Skip Tests**: तेजी execution के लिए tests skip करें
|
|
62
62
|
|
|
63
63
|
### 3. Push/PR Triggers
|
|
64
64
|
```yaml
|
|
@@ -108,14 +108,15 @@ Workflow की status check करने के लिए:
|
|
|
108
108
|
- Network connectivity check करें
|
|
109
109
|
- GitHub API rate limits check करें
|
|
110
110
|
|
|
111
|
-
## 📊 Workflow Features
|
|
111
|
+
## 📊 Simple Workflow Features
|
|
112
112
|
|
|
113
|
-
✅ **Auto Sync**:
|
|
114
|
-
✅ **Smart
|
|
115
|
-
✅ **
|
|
116
|
-
✅ **
|
|
117
|
-
✅ **
|
|
118
|
-
✅ **
|
|
113
|
+
✅ **Auto Chrome-launcher Sync**: ऑटोमेटिक chrome-launcher integration with all features
|
|
114
|
+
✅ **Smart Version Management**: Intelligent version increment and NPM publish
|
|
115
|
+
✅ **Dual Module Support**: CommonJS + ES Module builds maintained
|
|
116
|
+
✅ **Comprehensive Testing**: Full test suite with browser environment
|
|
117
|
+
✅ **Security First**: Secure token handling + NPM security audit
|
|
118
|
+
✅ **Simple Controls**: Just 2 options - Force Sync + Skip Tests
|
|
119
|
+
✅ **Complete Automation**: One workflow does everything automatically
|
|
119
120
|
|
|
120
121
|
---
|
|
121
122
|
|