Skip to content

Commit

Permalink
Update webpack.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AmolDerickSoans authored Dec 1, 2024
1 parent c9ab816 commit 2c0f07b
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Build
- name: Install Dependencies
run: npm ci

- name: Build Extension
run: |
npm install
npx webpack
npm run build
NODE_ENV=production npm run build
if [ $? -ne 0 ]; then
echo "Build failed"
exit 1
fi
- name: Validate Extension Files
run: |
Expand Down Expand Up @@ -57,25 +62,31 @@ jobs:
fi
fi
# Check file sizes
max_size=$((1024 * 1024 * 5)) # 5MB
find dist -type f -exec du -b {} + | while read size file; do
if [ "$size" -gt "$max_size" ]; then
echo "Error: $file exceeds 5MB limit"
exit 1
fi
done
echo "✓ Extension validation complete"
- name: Create Extension ZIP
if: startsWith(github.ref, 'refs/tags/')
run: |
cd dist
zip -r ../extension.zip *
cd ..
echo "✓ Extension ZIP created"
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: extension.zip
generate_release_notes: true

- name: Cleanup
run: |
rm -rf dist
rm -f extension.zip
echo "✓ Cleanup complete"
- name: Workflow Summary
run: |
echo "Build and validation completed successfully"
echo "Artifacts created and cleaned up"
echo "Workflow finished"

0 comments on commit 2c0f07b

Please sign in to comment.