CI: Build Web Extension

This PR/branch implements the automatic building + archiving of the Web Extension (for Firefox and Chrome).

It won't publish to the stores just yet, and for now Firefox is disabled, until we have the secrets set in GitHub.

Related to #330
This commit is contained in:
Bruno Bernardino 2021-12-21 14:01:06 +00:00
parent 516e573372
commit faac6f15f0
No known key found for this signature in database
GPG Key ID: D1B0A69ADD114ECE
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,45 @@
name: Build Web Extension
on:
workflow_dispatch:
push:
branches:
- "v4"
- "master"
paths:
- "packages/app/**"
- "packages/core/**"
- "packages/extension/**"
- "packages/locale/**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.13.1
- name: Install dependencies
run: |
npm ci
npm i -g web-ext@6.6.0
- name: Build
run: npm run web-extension:build
# - name: Sign for Firefox
# run: cd packages/extension/dist && web-ext sign --api-key=${{ secrets.WEB_EXT_API_KEY }} --api-secret=${{ secrets.WEB_EXT_API_SECRET }}
# - name: Archive Signed Extension (Firefox)
# uses: actions/upload-artifact@v2
# with:
# name: signed-extension-firefox-${{ github.sha }}.xpi
# path: *.xpi
# if-no-files-found: error
- name: Zip for Chrome
run: cd packages/extension/dist && zip chrome.zip . -x "*.xpi"
- name: Archive Unsigned Extension (Chrome)
uses: actions/upload-artifact@v2
with:
name: unsigned-extension-chrome-${{ github.sha }}.zip
path: chrome.zip
if-no-files-found: error

View File

@ -29,6 +29,7 @@
"server:start": "lerna run start --scope @padloc/server --stream",
"server:start-dry": "lerna run start-dry --stream --scope @padloc/server",
"electron:build": "cd packages/electron && npm run build && cd ../..",
"web-extension:build": "lerna run build --scope @padloc/extension",
"start": "npm run pwa:build && lerna run --scope '@padloc/{server,pwa}' --parallel start",
"dev": "lerna run --parallel --scope '@padloc/{server,pwa}' --parallel dev",
"tauri:dev": "lerna run --parallel --scope '@padloc/{server,tauri}' --parallel dev",