feat(BLDL23): automate browser extension packaging #1
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 Extension Packages | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "README.md" | |
| - "LICENSE" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "README.md" | |
| - "LICENSE" | |
| workflow_dispatch: # Allows manual re-run from GitHub UI | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # Continue on error to ensure we always get some output | |
| continue-on-error: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build extension packages | |
| run: npm run build | |
| - name: Validate Firefox modifications | |
| run: node -e "const m=JSON.parse(require('fs').readFileSync('build/firefox/manifest.json','utf8')); if(!m.background.scripts||!m.browser_specific_settings?.gecko||m.background.service_worker) {console.error('❌ Firefox manifest missing required modifications or still has service_worker'); process.exit(1);} console.log('✅ Firefox manifest properly modified')" | |
| - name: Upload Chrome extension artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: carbon-visualizer-chrome | |
| path: build/carbon-visualizer-chrome.zip | |
| retention-days: 30 | |
| - name: Upload Firefox extension artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: carbon-visualizer-firefox | |
| path: build/carbon-visualizer-firefox.zip | |
| retention-days: 30 | |
| - name: Upload build directory artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-directory | |
| path: build/ | |
| retention-days: 30 | |
| - name: Notify on failure | |
| if: failure() | |
| run: | | |
| echo "❌ Build failed! Check the logs above for details." |