Add Chromium Canary target
Bug: twpowertools:20
Change-Id: Ic6b8ef3832c3dff627c48e2274534cd1dd8a0b07
diff --git a/Makefile b/Makefile
index 4b501c0..44c40a2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_gecko_stable build_test_extension clean_releases clean
+.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_chromium_canary release_gecko_stable build_test_extension clean_releases clean
WEBPACK := ./node_modules/webpack-cli/bin/cli.js
RELEASE_SCRIPT := bash tools/release.bash
@@ -45,6 +45,11 @@
$(RELEASE_SCRIPT) -c beta -b chromium_mv3
rm -rf dist/chromium_mv3
+release_chromium_canary: deps
+ $(WEBPACK) --mode production --env browser_target=chromium_mv3 --env canary
+ $(RELEASE_SCRIPT) -c canary -b chromium_mv3
+ rm -rf dist/chromium_mv3
+
release_gecko_stable: deps
$(WEBPACK) --mode production --env browser_target=gecko
$(RELEASE_SCRIPT) -c stable -b gecko
diff --git a/src/icons/canary/128.png b/src/icons/canary/128.png
new file mode 100644
index 0000000..a194f32
--- /dev/null
+++ b/src/icons/canary/128.png
Binary files differ
diff --git a/src/icons/canary/512.png b/src/icons/canary/512.png
new file mode 100644
index 0000000..e174372
--- /dev/null
+++ b/src/icons/canary/512.png
Binary files differ
diff --git a/src/static/icons/128.png b/src/icons/regular/128.png
similarity index 100%
rename from src/static/icons/128.png
rename to src/icons/regular/128.png
Binary files differ
diff --git a/src/static/icons/512.png b/src/icons/regular/512.png
similarity index 100%
rename from src/static/icons/512.png
rename to src/icons/regular/512.png
Binary files differ
diff --git a/src/static/_locales/ar/messages.json b/src/static/_locales/ar/messages.json
index 1639ab1..e32c705 100644
--- a/src/static/_locales/ar/messages.json
+++ b/src/static/_locales/ar/messages.json
@@ -7,6 +7,10 @@
"message": "TW Power Tools (النّسخة التّجريبية)",
"description": "The extension's name for the beta version"
},
+ "appNameCanary": {
+ "message": "TW Power Tools (canary)",
+ "description": "The extension's name for the beta version"
+ },
"appNameGecko": {
"message": "TW Power Tools",
"description": "The extension's name (with a 50 character limit for Gecko)"
diff --git a/src/static/_locales/ca/messages.json b/src/static/_locales/ca/messages.json
index 42b2628..74dc395 100644
--- a/src/static/_locales/ca/messages.json
+++ b/src/static/_locales/ca/messages.json
@@ -7,6 +7,10 @@
"message": "Eines avançades per TW (beta)",
"description": "The extension's name for the beta version"
},
+ "appNameCanary": {
+ "message": "Eines avançades per TW (canary)",
+ "description": "The extension's name for the beta version"
+ },
"appNameGecko": {
"message": "Eines avançades per TW",
"description": "The extension's name (with a 50 character limit for Gecko)"
diff --git a/src/static/_locales/en/messages.json b/src/static/_locales/en/messages.json
index 9d544dd..f85ad5b 100644
--- a/src/static/_locales/en/messages.json
+++ b/src/static/_locales/en/messages.json
@@ -7,6 +7,10 @@
"message": "TW Power Tools (beta)",
"description": "The extension's name for the beta version"
},
+ "appNameCanary": {
+ "message": "TW Power Tools (canary)",
+ "description": "The extension's name for the beta version"
+ },
"appNameGecko": {
"message": "TW Power Tools",
"description": "The extension's name (with a 50 character limit for Gecko)"
diff --git a/src/static/_locales/es/messages.json b/src/static/_locales/es/messages.json
index 71cda7d..564bc16 100644
--- a/src/static/_locales/es/messages.json
+++ b/src/static/_locales/es/messages.json
@@ -7,6 +7,10 @@
"message": "Herramientas avanzadas para TW (beta)",
"description": "The extension's name for the beta version"
},
+ "appNameCanary": {
+ "message": "Herramientas avanzadas para TW (canary)",
+ "description": "The extension's name for the beta version"
+ },
"appNameGecko": {
"message": "Herramientas avanzadas para TW",
"description": "The extension's name (with a 50 character limit for Gecko)"
diff --git a/src/static/_locales/pt-rBR/messages.json b/src/static/_locales/pt-rBR/messages.json
index 92a2b45..f34e975 100644
--- a/src/static/_locales/pt-rBR/messages.json
+++ b/src/static/_locales/pt-rBR/messages.json
@@ -7,6 +7,10 @@
"message": "Super Ferramenta do TW (Beta)",
"description": "The extension's name for the beta version"
},
+ "appNameCanary": {
+ "message": "Super Ferramenta do TW (Canary)",
+ "description": "The extension's name for the beta version"
+ },
"appNameGecko": {
"message": "Super Ferramenta do TW",
"description": "The extension's name (with a 50 character limit for Gecko)"
diff --git a/src/static/_locales/ru/messages.json b/src/static/_locales/ru/messages.json
index 8ee730a..ba18ef7 100644
--- a/src/static/_locales/ru/messages.json
+++ b/src/static/_locales/ru/messages.json
@@ -7,6 +7,10 @@
"message": "TW Power Tools (beta)",
"description": "The extension's name for the beta version"
},
+ "appNameCanary": {
+ "message": "TW Power Tools (canary)",
+ "description": "The extension's name for the beta version"
+ },
"appNameGecko": {
"message": "TW Power Tools",
"description": "The extension's name (with a 50 character limit for Gecko)"
diff --git a/tools/release.bash b/tools/release.bash
index 338d9e1..e65441f 100644
--- a/tools/release.bash
+++ b/tools/release.bash
@@ -12,8 +12,8 @@
optional arguments:
-h, --help show this help message and exit
- -c, --channel indicates the channel of the release. Can be "beta"
- or "stable". Defaults to "stable".
+ -c, --channel indicates the channel of the release. Can be "beta",
+ "stable" or "canary". Defaults to "stable".
-b, --browser indicates the target browser for the release. Can be
"chromium", "gecko" or "chromium_mv3".
Defaults to "chromium".
@@ -52,14 +52,15 @@
esac
done
-if [[ $channel != "stable" && $channel != "beta" ]]; then
+if [[ $channel != "stable" && $channel != "beta" && \
+ $channel != "canary" ]]; then
echo "channel parameter value is incorrect." >&2
usage
exit
fi
-if [[ $browser != "chromium" && $browser != "gecko" &&
- $browser != "chromium_mv3" ]]; then
+if [[ $browser != "chromium" && $browser != "gecko" && \
+ $browser != "chromium_mv3" ]]; then
echo "browser parameter value is incorrect." >&2
usage
exit
@@ -73,17 +74,35 @@
# If the version name contains a hyphen then it isn't a release
# version. This is also the case if it doesn't start with a "v".
if [[ $version == *"-"* || $version != "v"* ]]; then
- # As it isn't a release version, setting version number to 0 so it
- # cannot be uploaded to the Chrome Web Store
- set_manifest_field "version" "0"
- set_manifest_field "version_name" "$version-$channel"
+ if [[ $channel == "canary" && $version == "v"* && \
+ $version != *"dirty" ]]; then
+ # If we're releasing a canary build and the build is not dirty,
+ # generate a version number
+ IFS='-' read -ra versionExplode <<< "${version:1}"
+ versionCanary="${versionExplode[0]}.${versionExplode[1]}"
+ set_manifest_field "version" "$versionCanary"
+ set_manifest_field "version_name" "$versionCanary-$channel"
+ else
+ # As it isn't a release version, setting version number to 0 so it
+ # cannot be uploaded to the Chrome Web Store
+ set_manifest_field "version" "0"
+ set_manifest_field "version_name" "$version-$channel"
+ fi
else
# It is a release version, set the version fields accordingly.
set_manifest_field "version" "${version:1}"
set_manifest_field "version_name" "${version:1}-$channel"
fi
-if [[ $channel == "beta" ]]; then
+if [[ $channel == "canary" ]]; then
+ # Change manifest.json to label the release as canary
+ set_manifest_field "name" "__MSG_appNameCanary__"
+
+ if [[ $browser == "gecko" ]]; then
+ # Change the extension ID
+ set_manifest_field "id" "twpowertools+canary@avm99963.com"
+ fi
+elif [[ $channel == "beta" ]]; then
# Change manifest.json to label the release as beta
set_manifest_field "name" "__MSG_appNameBeta__"
@@ -102,6 +121,6 @@
rm -rf out/twpowertools-$version-$browser-$channel.zip
(cd dist/$browser &&
zip -rq ../../out/twpowertools-$version-$browser-$channel.zip * -x "*/.git*" \
- -x "*/\.DS_Store" -x "*/OWNERS")
+ -x "*/\.DS_Store" -x "*/OWNERS")
echo "Done!"
diff --git a/webpack.config.js b/webpack.config.js
index 05542b9..90f67b6 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -88,6 +88,15 @@
new CopyWebpackPlugin({
patterns: [
{
+ from: path.join(
+ __dirname, 'src/icons', env.canary ? 'canary' : 'regular'),
+ to: path.join(outputPath, 'icons'),
+ },
+ ]
+ }),
+ new CopyWebpackPlugin({
+ patterns: [
+ {
from: path.join(__dirname, 'src/static'),
to: outputPath,
globOptions: {