Refactor CRX packaging in publish workflow

Replaces the previous CRX creation process with a more explicit file selection and temporary directory for packaging. Adds verification steps and cleanup to improve reliability and clarity of the extension build process.
This commit is contained in:
xixu-me committed 2025-07-11 17:26:36 +08:00
1 parent 013026a983
commit 4e97380fcd
1 file changed
+28 -10
+28 -10
View File
@@ -81,20 +81,38 @@ jobs:
# Create private key for CRX signing (for distribution only)
openssl genrsa -out key.pem 2048
# Create CRX file
crx3 -o extension.crx -p key.pem ./ \
--exclude="*.git*" \
--exclude="node_modules/*" \
--exclude=".github/*" \
--exclude="*.md" \
--exclude="LICENSE" \
--exclude="*.zip" \
--exclude="*.crx" \
--exclude="*.pem"
# Verify manifest.json exists
ls -la manifest.json
echo "Current directory: $(pwd)"
echo "Contents:"
ls -la
# Create temporary directory for extension files
mkdir -p extension-temp
# Copy extension files to temp directory
cp manifest.json extension-temp/
cp background.js extension-temp/
cp content.js extension-temp/
cp popup.html extension-temp/
cp popup.js extension-temp/
cp -r icons extension-temp/
# Verify temp directory contents
echo "Extension temp directory contents:"
ls -la extension-temp/
# Create CRX file from temp directory
cd extension-temp
crx3 -o ../extension.crx -p ../key.pem .
cd ..
echo "📦 Created extension.crx"
ls -la extension.crx
# Clean up
rm -rf extension-temp
- name: Publish to Chrome Web Store
continue-on-error: true
id: chrome-publish