Repository navigation
sidestr browser signer (window.nostr.sidestr.signTransaction), security-key fixes, 0.0.9 #23
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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-test-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Test | |
| run: npm test | |
| - name: Lint | |
| run: npm run lint | |
| - name: Package extension (sideloadable unpacked zip) | |
| run: | | |
| mkdir -p dist | |
| # vendor/ holds the sidestr engine the spend window imports (MV3 forbids remote code) | |
| zip -r dist/podkey-extension.zip manifest.json src popup vendor $([ -d icons ] && echo icons) -x '*.test.js' | |
| - name: Check the package holds every file the extension loads | |
| run: | | |
| python3 - <<'PY' | |
| import json, re, zipfile | |
| z = set(zipfile.ZipFile('dist/podkey-extension.zip').namelist()) | |
| m = json.load(open('manifest.json')) | |
| need = [m['background']['service_worker'], m['action']['default_popup'], *m['icons'].values()] | |
| need += [f for c in m['content_scripts'] for f in c['js']] | |
| need += [f for w in m.get('web_accessible_resources', []) for f in w['resources']] | |
| for page in ['popup/popup.html', 'popup/approve.html', 'popup/spend.html']: | |
| need += ['popup/' + r for r in re.findall(r'(?:src|href)="([^"#?:]+)"', open(page).read())] | |
| # the spend window's engine: every vendored file PINS.json records | |
| for pin in json.load(open('vendor/sidestr/PINS.json'))['pins']: | |
| need += [f"vendor/sidestr/{pin['name']}/{f}" for f in pin['files']] | |
| missing = sorted(set(need) - z) | |
| if missing: | |
| raise SystemExit('missing from the package: ' + ', '.join(missing)) | |
| print(f'package holds all {len(set(need))} files the extension loads') | |
| PY | |
| - name: Upload extension artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: podkey-extension | |
| path: dist/podkey-extension.zip | |
| if-no-files-found: error |