From b9843df604bf7936aa59e57d15a83c9ef0724ec8 Mon Sep 17 00:00:00 2001 From: Bobby Date: Wed, 24 Sep 2025 21:46:12 +0530 Subject: add build and release workflows --- .github/workflows/build.yml | 40 ++++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..be60863 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build extension + run: npm run build + + - name: Verify build output + run: | + if [ ! -d "build" ]; then + echo "❌ Build directory not found" + exit 1 + fi + if [ ! -f "build/manifest.json" ]; then + echo "❌ manifest.json not found in build directory" + exit 1 + fi + echo "✅ Build completed successfully" + ls -la build/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bc5523a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + release: + types: [created] + +permissions: + contents: write + +jobs: + build-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build and bundle extension + run: npm run release + + - name: Verify release file + run: | + if [ ! -d "release" ]; then + echo "❌ Release directory not found" + exit 1 + fi + XPI_COUNT=$(find release -name "*.xpi" | wc -l) + if [ "$XPI_COUNT" -eq 0 ]; then + echo "❌ No .xpi file found in release directory" + exit 1 + fi + echo "✅ Found $XPI_COUNT .xpi file(s) in release directory" + ls -la release/ + + - name: Upload release assets + uses: softprops/action-gh-release@v2 + with: + files: release/*.xpi + fail_on_unmatched_files: true \ No newline at end of file -- cgit v1.2.3