Files
Thingport/.github/workflows/extension-release.yml

76 lines
2.3 KiB
YAML

name: Extension checks
# Checks and builds Thingport Grab on every change to extension/. Releases, including the
# extension-latest builds for installing by hand, are extension-store-release.yml.
on:
push:
branches: [main]
paths:
- "extension/**"
- ".github/workflows/extension-release.yml"
pull_request:
branches: [main, develop]
paths:
- "extension/**"
- ".github/workflows/extension-release.yml"
workflow_dispatch: {}
concurrency:
group: extension-release-${{ github.ref }}
cancel-in-progress: true
jobs:
build-chrome:
# A main -> develop back-merge only brings release commits main already tested.
if: github.head_ref != 'main'
runs-on: ubuntu-latest
defaults:
run:
working-directory: extension
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: extension/package-lock.json
- run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Edge certification notes fit
run: npm run check:edge-notes
- name: Build and package
run: npm run zip:chrome && npm run zip:edge
- uses: actions/upload-artifact@v4
with:
name: thingport-grab-chrome
path: extension/dist/zips/thingport-grab-chrome.zip
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: thingport-grab-edge
path: extension/dist/zips/thingport-grab-edge.zip
if-no-files-found: error
build-firefox:
# A main -> develop back-merge only brings release commits main already tested.
if: github.head_ref != 'main'
runs-on: ubuntu-latest
defaults:
run:
working-directory: extension
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: extension/package-lock.json
- run: npm ci
- name: Build (and the source archive AMO asks for alongside bundled code)
run: npm run zip:firefox
- name: Lint (validates the built manifest for both PRs and pushes, no AMO credentials needed)
run: npx web-ext lint --source-dir dist/firefox