-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from AmolDerickSoans/main
updating develop
- Loading branch information
Showing
40 changed files
with
26,101 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
dist/ | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
@@ -132,3 +134,4 @@ dist | |
node_modules/ | ||
package-lock.json | ||
.DS_Store | ||
.env |
Oops, something went wrong.