Skip to content

Update ci

Update ci #3

Workflow file for this run

name: Build Extension
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
# -------------------------
# Checkout repository
# -------------------------
- name: Checkout
uses: actions/checkout@v4
# -------------------------
# Install tools
# -------------------------
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y jq zip rsync
npm install -g crx3
# -------------------------
# Read version from manifest
# -------------------------
- name: Read version from manifest
id: manifest
run: |
VERSION=$(jq -r .version manifest.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
# -------------------------
# Debug structure (helps if CI fails)
# -------------------------
- name: Debug repository
run: |
echo "Repository structure:"
ls -la
# =====================================================
# CHROME / EDGE BUILD
# =====================================================
- name: Prepare Chrome build
run: |
mkdir chrome-build
rsync -av \
--exclude='.git*' \
--exclude='.github' \
--exclude='node_modules' \
--exclude='*.zip' \
--exclude='*.crx' \
./ chrome-build/
- name: Build Chrome CRX
run: |
echo "${{ secrets.CHROME_EXTENSION_KEY }}" > key.pem
crx3 package chrome-build --key key.pem --out extension-chrome.crx
- name: Build Edge CRX
run: |
cp extension-chrome.crx extension-edge.crx
# =====================================================
# FIREFOX BUILD
# =====================================================
- name: Prepare Firefox build
run: |
mkdir firefox-build
rsync -av \
--exclude='.git*' \
--exclude='.github' \
--exclude='node_modules' \
--exclude='*.zip' \
--exclude='*.crx' \
./ firefox-build/
# Replace manifest
cp manifest_firefox.json firefox-build/manifest.json
- name: Build Firefox XPI
run: |
cd firefox-build
zip -r ../extension-firefox.xpi .
# =====================================================
# SOURCE ZIP
# =====================================================
- name: Build source zip
run: |
zip -r extension-source.zip . \
-x "*.git*" "*.github*" "node_modules/*" "*.crx" "*.xpi"
# =====================================================
# GITHUB RELEASE
# =====================================================
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.manifest.outputs.version }}
files: |
extension-chrome.crx
extension-edge.crx
extension-firefox.xpi
extension-source.zip