Skip to content

Release .crx

Release .crx #27

Workflow file for this run

name: Release .crx
on:
release:
types: [created]
workflow_dispatch:
permissions:
contents: write
jobs:
get-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Read package.json
uses: martinbeentjes/npm-get-version-action@main
build:
needs: get-version
runs-on: ubuntu-latest
steps:
- name: Build
run: |
npm ci
npm run build
- name: Pack .zip
uses: cardinalby/webext-buildtools-pack-extension-dir-action@v1
with:
extensionDir: 'dist'
zipFilePath: 'wai-v${{ needs.get-version.outputs.current-version }}.zip'
- name: Pack .crx
uses: cardinalby/webext-buildtools-chrome-crx-action@v2
with:
zipFilePath: 'wai-v${{ needs.get-version.outputs.current-version }}.zip'
crxFilePath: 'wai-v${{ needs.get-version.outputs.current-version }}.crx'
privateKey: ${{ secrets.CRX_PRIVATE_KEY }}
upload-chrome-store:
needs: [get-version, build]
runs-on: ubuntu-latest
steps:
- name: Upload to Chrome Web Store
uses: mnao305/chrome-extension-upload@v4.0.1
with:
extension-id: ackimleclkemolnfcfajficenpbnaiba
file-path: 'wai-v${{ needs.get-version.outputs.current-version }}.zip'
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
publish: false
upload-firefox-addons:
needs: [get-version, build]
runs-on: ubuntu-latest
steps:
- name: Upload to Add-ons for Firefox
uses: maoserr/firefox_extension_publish@v1.0.4
with:
firefox_extension_id: '{8ff02995-1ecd-4d77-9b1c-f4994f9ae70f}'
api_key: ${{ secrets.FIREFOX_JWT_ISSUER }}
api_secret: ${{ secrets.FIREFOX_JWT_SECRET }}
file: 'wai-v${{ needs.get-version.outputs.current-version }}.zip'
src_file: 'wai-v${{ needs.get-version.outputs.current-version }}.zip'
upload-github-release:
needs: [get-version, build]
runs-on: ubuntu-latest
steps:
- name: Update GitHub Release
uses: softprops/action-gh-release@v1
with:
draft: true
generate_release_notes: false
files: |
wai-v${{ needs.get-version.outputs.current-version }}.zip
wai-v${{ needs.get-version.outputs.current-version }}.crx