Skip to content

Commit 45a46d0

Browse files
andyleapclaude
andcommitted
feat: add GitHub Actions workflow for Chrome Web Store publishing
Add automated publishing workflow that: - Triggers on GitHub releases and manual dispatch - Runs type checking and tests as quality gates - Builds extension and publishes to Chrome Web Store - Uses existing GitHub secrets for authentication Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 85dccf6 commit 45a46d0

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish Chrome Extension
2+
3+
on:
4+
# Trigger when a GitHub release is published
5+
release:
6+
types: [published]
7+
8+
# Allow manual triggering for testing
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Run type check
29+
run: npm run typecheck
30+
31+
- name: Run tests
32+
run: npm test
33+
34+
- name: Build extension
35+
run: npm run build
36+
37+
- name: Extract version from manifest
38+
id: version
39+
run: |
40+
VERSION=$(node -p "require('./manifest.json').version")
41+
echo "VERSION=$VERSION" >> $GITHUB_ENV
42+
echo "Extension version: $VERSION"
43+
44+
- name: Upload to Chrome Web Store
45+
uses: mnao305/chrome-extension-upload@v5.0.0
46+
with:
47+
file-path: builds/${{ env.VERSION }}.zip
48+
extension-id: ${{ secrets.EXTENSION_ID }}
49+
client-id: ${{ secrets.CLIENT_ID }}
50+
client-secret: ${{ secrets.CLIENT_SECRET }}
51+
refresh-token: ${{ secrets.REFRESH_TOKEN }}
52+
publish: true
53+
54+
- name: Upload build artifact
55+
uses: actions/upload-artifact@v4
56+
if: always()
57+
with:
58+
name: extension-build-${{ env.VERSION }}
59+
path: builds/${{ env.VERSION }}.zip
60+
retention-days: 90

0 commit comments

Comments
 (0)