aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
blob: bc5523ab0c332e741a295bfeb5287f634e64d223 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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