Skip to content

1.4.6

1.4.6 #208

Workflow file for this run

name: "Build Extension"
on:
push:
pull_request:
workflow_dispatch:
inputs:
publish:
description: "Publish to stores"
type: boolean
default: false
env:
ARTIFACT_NAME: extension
jobs:
build:
name: Build extension
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "latest"
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm exec tsc && pnpm run lint
- name: Build extension
run: pnpm run build:all
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: build/*-prod.zip
create-release:
name: Create GitHub release
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
permissions:
contents: write
steps:
- name: Download built extensions
uses: actions/download-artifact@v4
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.ARTIFACT_NAME }}/*-prod.zip
publish:
name: Publish to stores
runs-on: ubuntu-latest
needs: build
if: ${{ inputs.publish == true || github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download built extensions
uses: actions/download-artifact@v4
- name: Publish to store
uses: PlasmoHQ/bpp@v3
with:
keys: ${{ secrets.SUBMIT_KEYS }}
chrome-file: ${{ env.ARTIFACT_NAME }}/chrome-mv3-prod.zip
firefox-file: ${{ env.ARTIFACT_NAME }}/firefox-mv3-prod.zip