File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,14 +38,21 @@ jobs:
3838 - name : Archive production artifacts
3939 uses : actions/upload-artifact@v4
4040 with :
41- name : all -artifacts
41+ name : production -artifacts
4242 path : |
43- dist/*.zip
4443 dist/*.crx
44+ dist/*.zip
4545
4646 - name : Archive extension
4747 uses : actions/upload-artifact@v4
4848 with :
49- name : scriptcat
49+ name : chrome-extension
5050 path : |
5151 dist/ext/*
52+
53+ - name : Archive Firefox extension
54+ uses : actions/upload-artifact@v4
55+ with :
56+ name : firefox-extension
57+ path : |
58+ dist/ext-firefox/*
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ chrome
120120 )
121121 ) ;
122122
123+ const firefoxZipName = `./dist/${ package . name } -v${ package . version } -firefox.zip` ;
123124firefox
124125 . generateNodeStream ( {
125126 type : "nodebuffer" ,
@@ -128,9 +129,19 @@ firefox
128129 } )
129130 . pipe (
130131 fs . createWriteStream (
131- `./dist/ ${ package . name } -v ${ package . version } -firefox.zip`
132+ firefoxZipName
132133 )
133- ) ;
134+ )
135+ . on ( "finish" , ( ) => {
136+ // 将firefox解压到ext-firefox
137+ fs . mkdirSync ( "./dist/ext-firefox" , { recursive : true } ) ;
138+ execSync (
139+ `unzip -o ${ firefoxZipName } -d ./dist/ext-firefox` ,
140+ {
141+ stdio : "inherit" ,
142+ }
143+ ) ;
144+ } ) ;
134145
135146// 处理crx
136147const crx = new ChromeExtension ( {
You can’t perform that action at this time.
0 commit comments