Skip to content

Commit fac9f19

Browse files
committed
feat(ci): upload extensions to stores
1 parent 4deaf42 commit fac9f19

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Upload to Chrome Web Store
2+
description: Upload extension zip from dist/ directory to Chrome Web Store
3+
4+
inputs:
5+
CHROME_EXT_ID:
6+
description: Chrome Web Store extension ID
7+
required: true
8+
CHROME_CLIENT_ID:
9+
description: Client ID for Chrome Web Store
10+
required: true
11+
CHROME_CLIENT_SECRET:
12+
description: Client secret for Chrome Web Store
13+
required: true
14+
CHROME_REFRESH_TOKEN:
15+
description: Refresh token for Chrome Web Store
16+
required: true
17+
18+
runs:
19+
using: composite
20+
21+
steps:
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with: { node-version-file: .nvmrc }
25+
26+
- name: Get extension path
27+
id: path
28+
shell: bash
29+
run: |
30+
CHROME_ZIP=$(find dist -type f -name "*chrome*.zip")
31+
echo "CHROME_ZIP=$CHROME_ZIP" >> $GITHUB_OUTPUT
32+
33+
- name: Upload to Chrome Web Store
34+
run: npx chrome-webstore-upload-cli@3 upload --source ${{ steps.path.outputs.chrome }}
35+
shell: bash
36+
env:
37+
EXTENSION_ID: ${{ inputs.CHROME_EXT_ID }}
38+
CLIENT_ID: ${{ inputs.CHROME_CLIENT_ID }}
39+
CLIENT_SECRET: ${{ inputs.CHROME_CLIENT_SECRET }}
40+
REFRESH_TOKEN: ${{ inputs.CHROME_REFRESH_TOKEN }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Upload to Firefox Addons
2+
description: Upload extension zip from dist/ directory to Firefox Addons
3+
4+
inputs:
5+
FIREFOX_API_KEY:
6+
description: API key for Firefox Addons
7+
required: true
8+
FIREFOX_API_SECRET:
9+
description: API secret for Firefox Addons
10+
required: true
11+
12+
runs:
13+
using: composite
14+
15+
steps:
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with: { node-version-file: .nvmrc }
19+
20+
- name: Get extension path
21+
id: path
22+
shell: bash
23+
run: |
24+
FIREFOX_ZIP=$(find dist -type f -name "*firefox*.zip")
25+
echo "FIREFOX_ZIP=$FIREFOX_ZIP" >> $GITHUB_OUTPUT
26+
27+
- name: Get source code
28+
shell: bash
29+
run: git archive --output source.zip HEAD
30+
31+
# TODO: figure out how to specify build zip file
32+
- name: Upload to Firefox Addons
33+
run: npx web-ext@8 sign --channel listed --upload-source-code ./source.zip
34+
shell: bash
35+
working-directory: artifact
36+
env:
37+
WEB_EXT_API_KEY: ${{ inputs.FIREFOX_API_KEY }}
38+
WEB_EXT_API_SECRET: ${{ inputs.FIREFOX_API_SECRET }}

0 commit comments

Comments
 (0)