Post 0 of 0 in "Releasing WebExtension using GitHub Actions" series

In this part we are going to create the workflow for publishing the extension on Microsoft Edge Add-ons. The reason why we are starting from the least popular store is that the process is going to be the easiest one among other stores.

🧱 Prepare

First, you need to find the Product ID of your extension. You can find it in Developer Dashboard. Be attentive, there are also 2 other identifiers that we don’t need - Store ID and CRX ID.

Next, follow the official documentation - create and obtain API credentials: Client ID, Client secret, Access token URL.

🔒 Add these values to secrets:

  • EDGE_PRODUCT_ID - Product_ID
  • EDGE_CLIENT_ID - Client ID
  • EDGE_CLIENT_SECRET - Client secret
  • EDGE_ACCESS_TOKEN_URL - Access token URL

publish-on-edge-add-ons workflow

The workflow will have the only trigger: workflow_dispatch event. It can be dispatched:

  1. Manually specifying any branch or tag as workflow ref.
  2. By publish-release-on-tag workflow after it has prepared a release with zip asset.

We will utilize already created get-zip-asset composite action to obtain packed zip that is needed for deploying the extension.

.github/workflows/publish-on-firefox-add-ons.yml :

name: publish-on-edge-add-ons
on:
  workflow_dispatch:
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: cardinalby/export-env-action@v1
        with:
          envFile: './.github/workflows/constants.env'
          expand: true

      - name: Obtain packed zip
        uses: ./.github/workflows/actions/get-zip-asset
        with:
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      - name: Deploy to Edge Addons
        uses: wdzeng/edge-addon@v1.0.3
        with:
          product-id: ${{ secrets.EDGE_PRODUCT_ID }}
          zip-path: ${{ env.ZIP_FILE_PATH }}
          client-id: ${{ secrets.EDGE_CLIENT_ID }}
          client-secret: ${{ secrets.EDGE_CLIENT_SECRET }}
          access-token-url: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
  1. As usual, at the beginning of each workflow we check out the repo and export env variables from constants.env file.
  2. After calling get-zip-asset composite action we expect to have zip file with packed and built extension at env.ZIP_FILE_PATH path.
  3. We pass its path along with other required inputs to publish-edge-add-on action to publish the extension.

Access Token expiration

When you were generating API credentials you could notice that API credentials have an expiration date - 2 years from now. In this article I don’t suggest any automated way for renewing it, so in 2 years your workflow will stop working, and you will need to create them again and put into secrets. We will face a similar problem with Google’s Refresh token later, but we will be able to cope with it.

Post 0 of 0 in "Releasing WebExtension using GitHub Actions" series