@@ -33,8 +33,8 @@ mkdir -p "$OUTPUT_DIR"
3333SCRIPT_DIR=" $( cd " $( dirname " $0 " ) " && pwd) "
3434. " $SCRIPT_DIR /parse-gitignore.sh" gitignore-excludes.txt
3535
36- # Find all files, excluding .gitignore patterns and Extension/filters/
37- ALL_FILES=$( find . -type f " ${GITIGNORE_EXCLUDE_ARGS[@]} " ! -path ' ./Extension/filters/*' \
36+ # Find all files, excluding .git, . gitignore patterns and Extension/filters/
37+ ALL_FILES=$( find . -type f ! -path ' ./.git/* ' " ${GITIGNORE_EXCLUDE_ARGS[@]} " ! -path ' ./Extension/filters/*' \
3838 | sed ' s|^\./||' | sort)
3939
4040# Find Extension/filters/firefox files
5353# Step 5: Create the zip from combined list
5454echo " $COMBINED_FILES " | zip -@ " $OUTPUT_ZIP "
5555
56+ # Append Firefox Add-ons Review team build instructions to README.md inside source.zip.
57+ # The review instructions are embedded here as a heredoc so everything stays in one file.
58+ # See https://extensionworkshop.com/documentation/publish/source-code-submission/
59+ TEMP_DIR=$( mktemp -d)
60+ unzip -o " $OUTPUT_ZIP " README.md -d " $TEMP_DIR "
61+ # Replace the TOC anchor with a TOC entry for the Firefox reviewer section.
62+ sed -i.bak ' s/<!-- TOC:AMO_REVIEW -->/- [Building Instructions for Firefox Add-ons Review Team](#building-instructions-for-firefox-add-ons-review-team)/' " $TEMP_DIR /README.md"
63+ rm -f " $TEMP_DIR /README.md.bak"
64+ cat >> " $TEMP_DIR /README.md" << 'REVIEW_EOF '
65+
66+ ## Building Instructions for Firefox Add-ons Review Team
67+
68+ This section is intended for the Firefox Add-ons Review team to reproduce
69+ the extension build from source.
70+
71+ ### Prerequisites
72+
73+ The only prerequisite is [Docker](https://docs.docker.com/get-docker/).
74+ All build tools (Node.js v22, pnpm v10) are pre-installed in the Docker image.
75+
76+ ### Building the release version
77+
78+ You can build the release version by running a single command:
79+
80+ ```sh
81+ docker run --rm \
82+ -v "$(pwd)":/workspace \
83+ -w /workspace \
84+ adguard/extension-builder:22.17--0.3.0--0 \
85+ bash -c "pnpm install && pnpm release firefox-amo"
86+ ```
87+
88+ The build output will be in the `./build/release/firefox-amo` directory.
89+ The resulting `firefox-amo.zip` can be compared with the uploaded add-on.
90+
91+ ### Building the beta version
92+
93+ ```sh
94+ docker run --rm \
95+ -v "$(pwd)":/workspace \
96+ -w /workspace \
97+ adguard/extension-builder:22.17--0.3.0--0 \
98+ bash -c "pnpm install && pnpm beta firefox-standalone"
99+ ```
100+
101+ The build output will be in the `./build/beta/firefox-standalone` directory.
102+ The resulting `firefox-standalone.zip` can be compared with the uploaded add-on.
103+ REVIEW_EOF
104+ ABS_OUTPUT_ZIP=" $( cd " $( dirname " $OUTPUT_ZIP " ) " && pwd) /$( basename " $OUTPUT_ZIP " ) "
105+ (cd " $TEMP_DIR " && zip " $ABS_OUTPUT_ZIP " README.md)
106+ rm -rf " $TEMP_DIR "
107+
56108echo " source.zip created at $OUTPUT_ZIP "
0 commit comments