Prepare chrome extension deployment (#3) #24
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Browser Extension | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| workflow_call: | |
| inputs: | |
| browser: | |
| description: Browser platform to build for (e.g., "chrome", '["firefox", "chrome"]') | |
| required: false | |
| default: '["chrome", "firefox"]' | |
| type: string | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| node-version: [18, 20] | |
| uses: ./.github/workflows/test.yml | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| browser: ${{ fromJSON(github.event.inputs.browser || '["chrome", "firefox"]') }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node v20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: 'package-lock.json' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build extension for ${{ matrix.browser }} | |
| run: npm run build-${{ matrix.browser }} | |
| - name: Upload extension zip | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.browser }}-extension | |
| path: dist/* | |
| if-no-files-found: error |