Skip to content

Commit 8830b65

Browse files
add CRX gen
1 parent 31ac229 commit 8830b65

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build-crx.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build CRX on Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-crx:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install zip tool
17+
run: sudo apt-get install -y zip
18+
19+
- name: Restore private key
20+
run: echo "${{ secrets.CHROME_PRIVATE_KEY }}" | base64 -d > key.pem
21+
22+
- name: Zip extension
23+
run: |
24+
mkdir -p dist
25+
zip -r dist/extension.zip . -x ".git/*" ".github/*" "node_modules/*" "*.pem" "dist/*"
26+
27+
- name: Install CRX packer
28+
run: npm install -g crx
29+
30+
- name: Build CRX
31+
run: |
32+
crx pack dist/extension.zip -o dist/extension.crx -p key.pem
33+
34+
- name: Upload CRX
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: chrome-extension
38+
path: dist/extension.crx

0 commit comments

Comments
 (0)