Skip to content

Publish Extension to All Stores #24

Publish Extension to All Stores

Publish Extension to All Stores #24

Workflow file for this run

name: Publish Extension to All Stores
on: [workflow_dispatch]
env:
MAX_PACKAGE_SIZE: 2621440 # 2.5MB in bytes
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "v22"
- name: Install dependencies
run: npm install
- name: Build for Chrome and Edge
run: npm run build
- name: Build for Firefox
run: npm run build:firefox
- name: Check file sizes
run: |
# Check Chrome/Edge package size
CHROME_SIZE=$(ls -l market_packages/target.zip | awk '{print $5}')
echo "Chrome/Edge package: $CHROME_SIZE bytes"
if [ $CHROME_SIZE -gt $MAX_PACKAGE_SIZE ]; then
echo "❌ Error: Chrome/Edge package exceeds size limit"
exit 1
else
echo "✅ Chrome/Edge package size is within limit"
fi
# Check Firefox package size
FIREFOX_SIZE=$(ls -l market_packages/target.firefox.zip | awk '{print $5}')
echo "Firefox package: $FIREFOX_SIZE bytes"
if [ $FIREFOX_SIZE -gt $MAX_PACKAGE_SIZE ]; then
echo "❌ Error: Firefox package exceeds size limit"
exit 1
else
echo "✅ Firefox package size is within limit"
fi
- name: Upload Chrome/Edge Artifact
uses: actions/upload-artifact@v4
with:
name: chrome-edge-package
path: market_packages/target.zip
- name: Upload Firefox XPI Artifact
uses: actions/upload-artifact@v4
with:
name: firefox-xpi-package
path: market_packages/target.firefox.zip
- name: Upload Firefox Source Artifact
uses: actions/upload-artifact@v4
with:
name: firefox-source-package
path: market_packages/target.src.zip
publish-chrome:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Chrome/Edge Artifact
uses: actions/download-artifact@v4
with:
name: chrome-edge-package
- name: Upload to Chrome Web Store
uses: mnao305/chrome-extension-upload@v5.0.0
with:
file-path: target.zip
extension-id: dkdhhcbjijekmneelocdllcldcpmekmm
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish: true
publish-edge:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Chrome/Edge Artifact
uses: actions/download-artifact@v4
with:
name: chrome-edge-package
- name: Upload to Edge Add-on Store
uses: wdzeng/edge-addon@v2
with:
zip-path: target.zip
product-id: 2a99ae83-5ec8-4ad2-aa63-9a276fc708ce
client-id: ${{ secrets.EDGE_CLIENT_ID }}
api-key: ${{ secrets.EDGE_API_KEY }}
upload-only: false
publish-firefox:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Firefox XPI Artifact
uses: actions/download-artifact@v4
with:
name: firefox-xpi-package
- name: Download Firefox Source Artifact
uses: actions/download-artifact@v4
with:
name: firefox-source-package
- name: Upload to Firefox Add-on Store
uses: wdzeng/firefox-addon@v1.2.0-alpha.0
with:
addon-guid: "{a8cf72f7-09b7-4cd4-9aaa-7a023bf09916}"
xpi-path: target.firefox.zip
source-file-path: target.src.zip
compatibility: firefox, android
jwt-issuer: ${{ secrets.FIREFOX_JWD_ISSUER }}
jwt-secret: ${{ secrets.FIREFOX_JWD_SECRET }}