Skip to content

Commit d573c49

Browse files
committed
chore: upload temp
1 parent 393b554 commit d573c49

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/dev.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ jobs:
9191
CRX_PRIV_KEY: ${{ secrets.CRX_PRIV_KEY }}
9292
PACK_PLATFORM: xpi,crx
9393
run: npm run pack
94+
- name: Upload temp
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: temp
98+
path: temp
9499
- name: Upload snapshot release
95100
uses: actions/upload-artifact@v4
96101
with:

scripts/pack-utils/crx.mjs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ChromeExtension from 'crx';
22
import { readFile, writeFile } from 'fs/promises';
3-
import { join, getVersion, getOutputFile } from '../config.mjs';
3+
import { getOutputFile, getVersion, join } from '../config.mjs';
44

55
async function createCrx(fileContent, keyContent) {
66
if (!keyContent) {
@@ -18,16 +18,29 @@ async function createCrx(fileContent, keyContent) {
1818
return crxBuffer;
1919
}
2020

21-
async function packCrx(sourcePath, zipPath, releasePath, browserConfig, itemConfig) {
21+
async function packCrx(
22+
sourcePath,
23+
zipPath,
24+
releasePath,
25+
browserConfig,
26+
itemConfig,
27+
) {
2228
const fileContent = await readFile(zipPath);
2329
if (typeof process.env[itemConfig.priv_key] === 'undefined') {
2430
throw new Error(`${itemConfig.priv_key} not found`);
2531
}
26-
const content = await createCrx(fileContent, process.env[itemConfig.priv_key]);
27-
const fileName = getOutputFile(itemConfig.browser, await getVersion(sourcePath), 'crx');
32+
const content = await createCrx(
33+
fileContent,
34+
process.env[itemConfig.priv_key],
35+
);
36+
const fileName = getOutputFile(
37+
itemConfig.browser,
38+
await getVersion(sourcePath),
39+
'crx',
40+
);
2841
const out = join(releasePath, fileName);
2942
await writeFile(out, content);
30-
const idFile = join(outputDir, `${fileName}-id.txt`);
43+
const idFile = join(releasePath, `${fileName}-id.txt`);
3144
await writeFile(idFile, itemConfig.id);
3245
return out;
3346
}

0 commit comments

Comments
 (0)