Skip to content

Commit b7e4603

Browse files
authored
feat: Upload source code with Firefox submission (#120)
Adds an archive command to generate a source code archive and tweaks our publish workflow to send this archive with our Firefox submission. Part of codecov/engineering-team#3536 (comment)
1 parent d240f0b commit b7e4603

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ jobs:
1515
- uses: actions/setup-node@v3
1616
with:
1717
node-version: "22"
18-
- run: npm ci
18+
- name: Generate source archive
19+
run: npm run archive
20+
- name: Install dependencies
21+
run: npm ci
1922
- name: Build extension
2023
run: npm run build
2124
env:
@@ -30,7 +33,8 @@ jobs:
3033
VERSION: ${{ github.event.release.tag_name }}
3134
- run: |
3235
cp -r dist dist-firefox
33-
cp dist-firefox/manifest.firefox.json dist-firefox/manifest.json
36+
mv dist-firefox/manifest.firefox.json dist-firefox/manifest.json
37+
mv codecov-browser-extension.tar.gz dist-firefox
3438
- name: Publish to Chrome
3539
working-directory: dist
3640
run: npx chrome-webstore-upload-cli@2 upload --auto-publish
@@ -41,7 +45,8 @@ jobs:
4145
REFRESH_TOKEN: ${{ secrets.GOOGLE_WEB_STORE_REFRESH_TOKEN }}
4246
- name: Publish to Firefox
4347
working-directory: dist-firefox
44-
run: npx web-ext-submit@7
48+
run: npx web-ext sign --use-submission-api --channel listed
4549
env:
4650
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_JWT_ISSUER }}
4751
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_JWT_SECRET }}
52+
WEB_EXT_API_UPLOAD_SOURCE_CODE: codecov-browser-extension.tar.gz

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
dist/
44
tmp/
55
.vscode/
6+
codecov-browser-extension.tar.gz

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ As of today, GitHub will show you the old UI if not logged in (running in a temp
7575

7676
These steps will build the extension in the `dist/` folder.
7777

78-
MacOS 13.3.1 (22E261)
79-
NodeJS version 19.8.1
78+
Node 22 and npm 10
8079

8180
Chrome
8281

@@ -90,7 +89,7 @@ Firefox
9089
```sh
9190
$ npm install
9291
$ npm run build
93-
$ cp dist/manifest.firefox.json dist/manifest.json
92+
$ mv dist/manifest.firefox.json dist/manifest.json
9493
```
9594

9695
## About Codecov

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"watch": "webpack --config webpack/webpack.dev.js --watch",
88
"build": "webpack --config webpack/webpack.prod.js",
99
"build.firefox": "npm run build && mv dist/manifest.firefox.json dist/manifest.json",
10-
"lint": "prettier --write \"src/**/*.{ts,tsx}\""
10+
"lint": "prettier --write \"src/**/*.{ts,tsx}\"",
11+
"archive": "tar -czvf codecov-browser-extension.tar.gz --exclude node_modules ./*"
1112
},
1213
"author": "",
1314
"license": "UNLICENSED",

0 commit comments

Comments
 (0)