Skip to content

Commit

Permalink
feat(ci): upload extensions to stores
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Aug 26, 2024
1 parent 4deaf42 commit fac9f19
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/actions/upload-chrome/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Upload to Chrome Web Store
description: Upload extension zip from dist/ directory to Chrome Web Store

inputs:
CHROME_EXT_ID:
description: Chrome Web Store extension ID
required: true
CHROME_CLIENT_ID:
description: Client ID for Chrome Web Store
required: true
CHROME_CLIENT_SECRET:
description: Client secret for Chrome Web Store
required: true
CHROME_REFRESH_TOKEN:
description: Refresh token for Chrome Web Store
required: true

runs:
using: composite

steps:
- name: Setup Node
uses: actions/setup-node@v4
with: { node-version-file: .nvmrc }

- name: Get extension path
id: path
shell: bash
run: |
CHROME_ZIP=$(find dist -type f -name "*chrome*.zip")
echo "CHROME_ZIP=$CHROME_ZIP" >> $GITHUB_OUTPUT
- name: Upload to Chrome Web Store
run: npx chrome-webstore-upload-cli@3 upload --source ${{ steps.path.outputs.chrome }}

Check warning on line 34 in .github/actions/upload-chrome/action.yaml

View workflow job for this annotation

GitHub Actions / Lint

Unknown word (webstore)
shell: bash
env:
EXTENSION_ID: ${{ inputs.CHROME_EXT_ID }}
CLIENT_ID: ${{ inputs.CHROME_CLIENT_ID }}
CLIENT_SECRET: ${{ inputs.CHROME_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ inputs.CHROME_REFRESH_TOKEN }}
38 changes: 38 additions & 0 deletions .github/actions/upload-firefox/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Upload to Firefox Addons
description: Upload extension zip from dist/ directory to Firefox Addons

inputs:
FIREFOX_API_KEY:
description: API key for Firefox Addons
required: true
FIREFOX_API_SECRET:
description: API secret for Firefox Addons
required: true

runs:
using: composite

steps:
- name: Setup Node
uses: actions/setup-node@v4
with: { node-version-file: .nvmrc }

- name: Get extension path
id: path
shell: bash
run: |
FIREFOX_ZIP=$(find dist -type f -name "*firefox*.zip")
echo "FIREFOX_ZIP=$FIREFOX_ZIP" >> $GITHUB_OUTPUT
- name: Get source code
shell: bash
run: git archive --output source.zip HEAD

# TODO: figure out how to specify build zip file
- name: Upload to Firefox Addons
run: npx web-ext@8 sign --channel listed --upload-source-code ./source.zip
shell: bash
working-directory: artifact
env:
WEB_EXT_API_KEY: ${{ inputs.FIREFOX_API_KEY }}
WEB_EXT_API_SECRET: ${{ inputs.FIREFOX_API_SECRET }}

0 comments on commit fac9f19

Please sign in to comment.