Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,21 @@ jobs:
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: all-artifacts
name: production-artifacts
path: |
dist/*.zip
dist/*.crx
dist/*.zip

- name: Archive extension
uses: actions/upload-artifact@v4
with:
name: scriptcat
name: chrome-extension
path: |
dist/ext/*

- name: Archive Firefox extension
uses: actions/upload-artifact@v4
with:
name: firefox-extension
path: |
dist/ext-firefox/*
15 changes: 13 additions & 2 deletions build/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ chrome
)
);

const firefoxZipName = `./dist/${package.name}-v${package.version}-firefox.zip`;
firefox
.generateNodeStream({
type: "nodebuffer",
Expand All @@ -128,9 +129,19 @@ firefox
})
.pipe(
fs.createWriteStream(
`./dist/${package.name}-v${package.version}-firefox.zip`
firefoxZipName
)
);
)
.on("finish", () => {
// 将firefox解压到ext-firefox
fs.mkdirSync("./dist/ext-firefox", { recursive: true });
execSync(
`unzip -o ${firefoxZipName} -d ./dist/ext-firefox`,
{
stdio: "inherit",
}
);
});

// 处理crx
const crx = new ChromeExtension({
Expand Down