Skip to content

Commit

Permalink
feat: Add Bundle analysis (#116)
Browse files Browse the repository at this point in the history
Adds a new ci.yml workflow to build and upload bundle stats to Codecov.
Renames old ci.yml to publish.yml.
  • Loading branch information
spalmurray-codecov authored Feb 14, 2025
1 parent 76cc43e commit bcb59cb
Show file tree
Hide file tree
Showing 5 changed files with 772 additions and 92 deletions.
40 changes: 8 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
name: ci
on:
release:
types: [published]

permissions:
id-token: write

on: push

jobs:
publish:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18.x'
node-version: "22"
- run: npm ci
- name: Build extension
run: npm run build
env:
SENTRY_DSN: ${{ vars.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- run: |
jq --arg version "$VERSION" '.version=$version' dist/manifest.json > manifest.tmp.json \
&& mv manifest.tmp.json dist/manifest.json
jq --arg version "$VERSION" '.version=$version' dist/manifest.firefox.json > manifest.tmp.json \
&& mv manifest.tmp.json dist/manifest.firefox.json
env:
VERSION: ${{ github.event.release.tag_name }}
- run: |
cp -r dist dist-firefox
cp dist-firefox/manifest.firefox.json dist-firefox/manifest.json
- name: Publish to Chrome
working-directory: dist
run: npx chrome-webstore-upload-cli@2 upload --auto-publish
env:
EXTENSION_ID: "gedikamndpbemklijjkncpnolildpbgo"
CLIENT_ID: ${{ secrets.GOOGLE_WEB_STORE_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.GOOGLE_WEB_STORE_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.GOOGLE_WEB_STORE_REFRESH_TOKEN }}
- name: Publish to Firefox
working-directory: dist-firefox
run: npx web-ext-submit@7
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_JWT_ISSUER }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_JWT_SECRET }}
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: publish

permissions:
id-token: write

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "22"
- run: npm ci
- name: Build extension
run: npm run build
env:
SENTRY_DSN: ${{ vars.SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- run: |
jq --arg version "$VERSION" '.version=$version' dist/manifest.json > manifest.tmp.json \
&& mv manifest.tmp.json dist/manifest.json
jq --arg version "$VERSION" '.version=$version' dist/manifest.firefox.json > manifest.tmp.json \
&& mv manifest.tmp.json dist/manifest.firefox.json
env:
VERSION: ${{ github.event.release.tag_name }}
- run: |
cp -r dist dist-firefox
cp dist-firefox/manifest.firefox.json dist-firefox/manifest.json
- name: Publish to Chrome
working-directory: dist
run: npx chrome-webstore-upload-cli@2 upload --auto-publish
env:
EXTENSION_ID: "gedikamndpbemklijjkncpnolildpbgo"
CLIENT_ID: ${{ secrets.GOOGLE_WEB_STORE_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.GOOGLE_WEB_STORE_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.GOOGLE_WEB_STORE_REFRESH_TOKEN }}
- name: Publish to Firefox
working-directory: dist-firefox
run: npx web-ext-submit@7
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_JWT_ISSUER }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_JWT_SECRET }}
Loading

0 comments on commit bcb59cb

Please sign in to comment.