UX and Sentry Improvement #99
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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
name: Build Extension | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: | |
- main | |
- develop | |
env: | |
CRX_VER: v0.0.0-${{ github.sha }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "latest" | |
cache: "npm" | |
cache-dependency-path: package-lock.json | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Set version | |
if: ${{ github.ref_type == 'tag' }} | |
run: echo "CRX_VER=${{ github.ref_name }}" >> $GITHUB_ENV | |
- name: Preparing | |
run: | | |
echo "Current version ${{ env.CRX_VER }}" | |
mkdir "${{ github.workspace }}/release/" | |
git archive --format tar.gz HEAD -o "${{ github.workspace }}/release/source.tar.gz" | |
- name: Build Chrome Extension | |
env: | |
SENTRY_RELEASE: ${{ env.CRX_VER }} | |
run: | | |
npm run build | |
cd "${{ github.workspace }}/dist/" && zip -r "${{ github.workspace }}/release/crx.zip" ./ | |
- name: Build Firefox Add-ons | |
env: | |
SENTRY_RELEASE: ${{ env.CRX_VER }} | |
run: | | |
npm run build:firefox | |
cd "${{ github.workspace }}/dist/" && zip -r "${{ github.workspace }}/release/firefox.zip" ./ | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Proxyverse | |
path: ${{ github.workspace }}/release/* | |
release-github: | |
name: Publish on Github Release | |
if: ${{ github.ref_type == 'tag' }} | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Proxyverse | |
path: ${{ github.workspace }}/release/ | |
- name: Upload to release page | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ${{ github.workspace }}/release/* | |
release-chrome: | |
name: Publish on Chrome | |
if: ${{ github.ref_type == 'tag' }} | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Proxyverse | |
path: ${{ github.workspace }}/release/ | |
- name: Upload to Chrome Web Store | |
uses: wdzeng/chrome-extension@v1 | |
with: | |
extension-id: igknmaflmijecdmjpcgollghmipkfbho | |
zip-path: ${{ github.workspace }}/release/crx.zip | |
client-id: ${{ secrets.CHROME_CLIENT_ID }} | |
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} | |
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} | |
release-edge: | |
name: Publish on Edge | |
if: ${{ github.ref_type == 'tag' }} | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Proxyverse | |
path: ${{ github.workspace }}/release/ | |
- name: Upload to MS Edge | |
uses: wdzeng/edge-addon@v2 | |
with: | |
product-id: 6fa97660-6c21-41e4-87e6-06a88509753f | |
zip-path: ${{ github.workspace }}/release/crx.zip | |
client-id: ${{ secrets.EDGE_CLIENT_ID }} | |
api-key: ${{ secrets.EDGE_API_KEY }} | |
release-firefox: | |
name: Publish on Firefox | |
if: ${{ github.ref_type == 'tag' }} | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Proxyverse | |
path: ${{ github.workspace }}/release/ | |
- name: Upload to Firefox | |
uses: wdzeng/firefox-addon@v1 | |
with: | |
addon-guid: [email protected] | |
xpi-path: ${{ github.workspace }}/release/firefox.zip | |
source-file-path: ${{ github.workspace }}/release/source.tar.gz | |
license: MIT | |
self-hosted: false | |
jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }} | |
jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }} |