Skip to content

Commit

Permalink
Merge pull request #3 from AmolDerickSoans/main
Browse files Browse the repository at this point in the history
updating develop
  • Loading branch information
AmolDerickSoans authored Dec 24, 2024
2 parents 9bbd5fc + 684148c commit 31f46e6
Show file tree
Hide file tree
Showing 40 changed files with 26,101 additions and 459 deletions.
Binary file modified .DS_Store
Binary file not shown.
92 changes: 92 additions & 0 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build and Release Extension

on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm ci

- name: Build Extension
run: |
NODE_ENV=production npm run build
if [ $? -ne 0 ]; then
echo "Build failed"
exit 1
fi
- name: Validate Extension Files
run: |
# Check required files exist
required_files=("manifest.json" "popup/index.html" "background/background.js" "assets/icons/icon16.png" "assets/icons/icon48.png" "assets/icons/icon128.png")
for file in "${required_files[@]}"; do
if [ ! -f "dist/$file" ]; then
echo "Error: Required file $file is missing"
exit 1
fi
done
# Validate manifest.json
if ! jq empty dist/manifest.json; then
echo "Error: Invalid manifest.json"
exit 1
fi
# Check manifest version matches tag
if [[ "${{ github.ref }}" =~ ^refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
version="${BASH_REMATCH[1]}"
manifest_version=$(jq -r .version dist/manifest.json)
if [ "$version" != "$manifest_version" ]; then
echo "Error: Tag version ($version) doesn't match manifest version ($manifest_version)"
exit 1
fi
fi
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"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
dist/

# Logs
logs
*.log
Expand Down Expand Up @@ -132,3 +134,4 @@ dist
node_modules/
package-lock.json
.DS_Store
.env
Loading

0 comments on commit 31f46e6

Please sign in to comment.