Skip to content

Commit 13bf755

Browse files
committed
Add packaging and release workflow for Chrome extension
- Introduce npm script for packaging extension - Create GitHub Actions workflow to automate extension packaging - Add archiver dependency for creating ZIP archives - Implement bundling script to generate extension package - Configure artifact upload and release creation
1 parent 9d4462d commit 13bf755

File tree

7 files changed

+1030
-12
lines changed

7 files changed

+1030
-12
lines changed

.github/workflows/pacakge.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Package Chrome Extension
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-package:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
cache: 'npm'
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Build and package extension
26+
run: npm run pack
27+
28+
- name: Upload packaged extension
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: chrome-extension
32+
path: package/*.zip
33+
34+
- name: Commit package to repository
35+
run: |
36+
git config --global user.name 'GitHub Actions'
37+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
38+
git add package/*.zip
39+
git commit -m "Update packaged extension" || exit 0
40+
git push
41+
42+
- name: Get current date
43+
id: date
44+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
45+
46+
- name: Create Release
47+
uses: softprops/action-gh-release@v1
48+
with:
49+
name: Release ${{ steps.date.outputs.date }}
50+
tag_name: release-${{ steps.date.outputs.date }}
51+
files: package/*.zip
52+
generate_release_notes: true
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/
22
node_modules/
3+
package/*.zip

0 commit comments

Comments
 (0)