From 36ed922b5c8ac6fbb4742db41ac67b2d78d7b859 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Wed, 1 Apr 2026 16:29:19 -0400 Subject: [PATCH 1/3] Add interactive deploy scripts for beta and AMO stable releases --- scripts/deploy-amo-stable.sh | 54 ++++++++++++++++++++++++++++++++++++ scripts/deploy-beta.sh | 49 ++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100755 scripts/deploy-amo-stable.sh create mode 100755 scripts/deploy-beta.sh diff --git a/scripts/deploy-amo-stable.sh b/scripts/deploy-amo-stable.sh new file mode 100755 index 0000000..daa9e68 --- /dev/null +++ b/scripts/deploy-amo-stable.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# Merge beta β†’ main, push main, and push an annotated stable tag (v* without -beta). +# Triggers .github/workflows/deploy.yml: listed AMO submission. + +set -euo pipefail + +ROOT="$(git rev-parse --show-toplevel)" +cd "$ROOT" + +manifest_version() { + python3 -c 'import json; print(json.load(open("manifest.json"))["version"])' +} + +if [[ -n "$(git status --porcelain)" ]]; then + echo "Error: working tree is not clean. Commit or stash before releasing." >&2 + exit 1 +fi + +echo "Current version in manifest.json: $(manifest_version)" +echo "Stable AMO releases use a tag like v5.0.3 (no '-beta' in the tag per deploy.yml)." +read -r -p "Annotated tag to create and push: " VERSION +VERSION="${VERSION#"${VERSION%%[![:space:]]*}"}" +VERSION="${VERSION%"${VERSION##*[![:space:]]}"}" +if [[ -z "$VERSION" ]]; then + echo "Error: empty version." >&2 + exit 1 +fi +if [[ "$VERSION" == *-beta* ]]; then + echo "Warning: tag contains '-beta'; workflow will treat this as beta (unlisted + prerelease), not stable AMO listed." + read -r -p "Continue anyway? [y/N] " w + [[ "${w:-}" =~ ^[yY](es)?$ ]] || { echo "Aborted."; exit 1; } +fi + +echo +echo "This will:" +echo " 1. checkout main, merge beta (no-ff), push origin main" +echo " 2. create tag $VERSION on main and push it (triggers listed AMO submit)" +echo " 3. checkout dev" +read -r -p "Continue? [y/N] " confirm +[[ "${confirm:-}" =~ ^[yY](es)?$ ]] || { echo "Aborted."; exit 1; } + +echo "πŸš€ Releasing stable $VERSION to AMO (listed)" + +git checkout main +git pull origin main +git merge beta --no-ff -m "Merge beta ($VERSION)" +git push origin main + +git tag -a "$VERSION" -m "$VERSION" +git push origin "$VERSION" + +git checkout dev + +echo "βœ… Done: stable $VERSION (main merge + tag pushed)" diff --git a/scripts/deploy-beta.sh b/scripts/deploy-beta.sh new file mode 100755 index 0000000..6997b4a --- /dev/null +++ b/scripts/deploy-beta.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +# Merge dev β†’ beta, push beta, and push an annotated beta tag (v*-beta*). +# Triggers .github/workflows/deploy.yml: unlisted AMO sign + GitHub prerelease. + +set -euo pipefail + +ROOT="$(git rev-parse --show-toplevel)" +cd "$ROOT" + +manifest_version() { + python3 -c 'import json; print(json.load(open("manifest.json"))["version"])' +} + +if [[ -n "$(git status --porcelain)" ]]; then + echo "Error: working tree is not clean. Commit or stash before releasing." >&2 + exit 1 +fi + +echo "Current version in manifest.json: $(manifest_version)" +echo "Beta tags should include '-beta' (e.g. v5.0.3-beta.1) to match deploy.yml." +read -r -p "Annotated tag to create and push: " VERSION +VERSION="${VERSION#"${VERSION%%[![:space:]]*}"}" +VERSION="${VERSION%"${VERSION##*[![:space:]]}"}" +if [[ -z "$VERSION" ]]; then + echo "Error: empty version." >&2 + exit 1 +fi + +echo +echo "This will:" +echo " 1. checkout beta, merge dev (no-ff), push origin beta" +echo " 2. create tag $VERSION and push it (triggers beta AMO + prerelease)" +echo " 3. checkout dev" +read -r -p "Continue? [y/N] " confirm +[[ "${confirm:-}" =~ ^[yY](es)?$ ]] || { echo "Aborted."; exit 1; } + +echo "πŸš€ Releasing beta $VERSION" + +git checkout beta +git pull origin beta +git merge dev --no-ff -m "$VERSION" +git push origin beta + +git tag -a "$VERSION" -m "$VERSION" +git push origin "$VERSION" + +git checkout dev + +echo "βœ… Done: beta $VERSION (merge + tag pushed)" From 5a38121e09b7489e61c9d3e1f9b7d1f496d0da93 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Wed, 1 Apr 2026 16:31:29 -0400 Subject: [PATCH 2/3] refactor: scripts update --- scripts/deploy-amo-stable.sh | 87 ++++++++++++++++++++++++++++-------- scripts/deploy-beta.sh | 81 +++++++++++++++++++++++++++------ 2 files changed, 135 insertions(+), 33 deletions(-) diff --git a/scripts/deploy-amo-stable.sh b/scripts/deploy-amo-stable.sh index daa9e68..340aa6f 100755 --- a/scripts/deploy-amo-stable.sh +++ b/scripts/deploy-amo-stable.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Merge beta β†’ main, push main, and push an annotated stable tag (v* without -beta). +# Bump manifest on dev, merge devβ†’betaβ†’main, push an annotated stable tag (v* without -beta). # Triggers .github/workflows/deploy.yml: listed AMO submission. set -euo pipefail @@ -11,44 +11,93 @@ manifest_version() { python3 -c 'import json; print(json.load(open("manifest.json"))["version"])' } +bump_manifest() { + local ver="$1" + VER="$ver" python3 <<'PY' +import json +import os + +ver = os.environ["VER"] +path = "manifest.json" +with open(path, encoding="utf-8") as f: + data = json.load(f) +data["version"] = ver +with open(path, "w", encoding="utf-8") as f: + json.dump(data, f, indent=2) + f.write("\n") +PY +} + +normalize_semver() { + local s="$1" + s="${s#"${s%%[![:space:]]*}"}" + s="${s%"${s##*[![:space:]]}"}" + s="${s#v}" + s="${s#V}" + printf '%s' "$s" +} + +validate_semver() { + local s="$1" + if [[ -z "$s" ]]; then + echo "Error: empty version." >&2 + return 1 + fi + if [[ ! "$s" =~ ^[0-9]+(\.[0-9]+){0,3}(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then + echo "Error: invalid version (use something like 5.0.4)." >&2 + return 1 + fi +} + if [[ -n "$(git status --porcelain)" ]]; then echo "Error: working tree is not clean. Commit or stash before releasing." >&2 exit 1 fi +git checkout dev +git pull origin dev + echo "Current version in manifest.json: $(manifest_version)" -echo "Stable AMO releases use a tag like v5.0.3 (no '-beta' in the tag per deploy.yml)." -read -r -p "Annotated tag to create and push: " VERSION -VERSION="${VERSION#"${VERSION%%[![:space:]]*}"}" -VERSION="${VERSION%"${VERSION##*[![:space:]]}"}" -if [[ -z "$VERSION" ]]; then - echo "Error: empty version." >&2 - exit 1 -fi -if [[ "$VERSION" == *-beta* ]]; then - echo "Warning: tag contains '-beta'; workflow will treat this as beta (unlisted + prerelease), not stable AMO listed." +read -r -p "New version for manifest.json (e.g. 5.0.4): " SEMVER_IN +SEMVER="$(normalize_semver "$SEMVER_IN")" +validate_semver "$SEMVER" + +TAG="v${SEMVER}" +if [[ "$TAG" == *-beta* ]]; then + echo "Warning: stable tags should not contain '-beta' (workflow would use unlisted + prerelease, not AMO listed)." read -r -p "Continue anyway? [y/N] " w [[ "${w:-}" =~ ^[yY](es)?$ ]] || { echo "Aborted."; exit 1; } fi echo echo "This will:" -echo " 1. checkout main, merge beta (no-ff), push origin main" -echo " 2. create tag $VERSION on main and push it (triggers listed AMO submit)" -echo " 3. checkout dev" +echo " 1. set manifest.json version to $SEMVER and commit on dev" +echo " 2. merge dev β†’ beta and push beta" +echo " 3. merge beta β†’ main and push main" +echo " 4. create tag $TAG on main and push it (triggers listed AMO submit)" +echo " 5. checkout dev" read -r -p "Continue? [y/N] " confirm [[ "${confirm:-}" =~ ^[yY](es)?$ ]] || { echo "Aborted."; exit 1; } -echo "πŸš€ Releasing stable $VERSION to AMO (listed)" +echo "πŸš€ Releasing stable $TAG to AMO (listed)" + +bump_manifest "$SEMVER" +git add manifest.json +git commit -m "Bump version to $SEMVER" + +git checkout beta +git pull origin beta +git merge dev --no-ff -m "Merge dev ($TAG)" +git push origin beta git checkout main git pull origin main -git merge beta --no-ff -m "Merge beta ($VERSION)" +git merge beta --no-ff -m "Merge beta ($TAG)" git push origin main -git tag -a "$VERSION" -m "$VERSION" -git push origin "$VERSION" +git tag -a "$TAG" -m "$TAG" +git push origin "$TAG" git checkout dev -echo "βœ… Done: stable $VERSION (main merge + tag pushed)" +echo "βœ… Done: stable $TAG (manifest $SEMVER, main + tag pushed)" diff --git a/scripts/deploy-beta.sh b/scripts/deploy-beta.sh index 6997b4a..6976001 100755 --- a/scripts/deploy-beta.sh +++ b/scripts/deploy-beta.sh @@ -11,39 +11,92 @@ manifest_version() { python3 -c 'import json; print(json.load(open("manifest.json"))["version"])' } +bump_manifest() { + local ver="$1" + VER="$ver" python3 <<'PY' +import json +import os + +ver = os.environ["VER"] +path = "manifest.json" +with open(path, encoding="utf-8") as f: + data = json.load(f) +data["version"] = ver +with open(path, "w", encoding="utf-8") as f: + json.dump(data, f, indent=2) + f.write("\n") +PY +} + +normalize_semver() { + local s="$1" + s="${s#"${s%%[![:space:]]*}"}" + s="${s%"${s##*[![:space:]]}"}" + s="${s#v}" + s="${s#V}" + printf '%s' "$s" +} + +validate_semver() { + local s="$1" + if [[ -z "$s" ]]; then + echo "Error: empty version." >&2 + return 1 + fi + if [[ ! "$s" =~ ^[0-9]+(\.[0-9]+){0,3}(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then + echo "Error: invalid version (use something like 5.0.4 or 5.0.4-beta.1)." >&2 + return 1 + fi +} + if [[ -n "$(git status --porcelain)" ]]; then echo "Error: working tree is not clean. Commit or stash before releasing." >&2 exit 1 fi +git checkout dev +git pull origin dev + echo "Current version in manifest.json: $(manifest_version)" -echo "Beta tags should include '-beta' (e.g. v5.0.3-beta.1) to match deploy.yml." -read -r -p "Annotated tag to create and push: " VERSION -VERSION="${VERSION#"${VERSION%%[![:space:]]*}"}" -VERSION="${VERSION%"${VERSION##*[![:space:]]}"}" -if [[ -z "$VERSION" ]]; then - echo "Error: empty version." >&2 +read -r -p "New version for manifest.json (e.g. 5.0.4): " SEMVER_IN +SEMVER="$(normalize_semver "$SEMVER_IN")" +validate_semver "$SEMVER" + +echo "Beta git tag will include '-beta' (required by deploy.yml)." +read -r -p "Beta tag suffix [beta.1]: " SUFFIX_IN +SUFFIX="${SUFFIX_IN#"${SUFFIX_IN%%[![:space:]]*}"}" +SUFFIX="${SUFFIX%"${SUFFIX##*[![:space:]]}"}" +SUFFIX="${SUFFIX:-beta.1}" + +TAG="v${SEMVER}-${SUFFIX}" +if [[ "$TAG" != *-beta* ]]; then + echo "Error: beta tag must contain '-beta' for the workflow (got $TAG). Try suffix like beta.1." >&2 exit 1 fi echo echo "This will:" -echo " 1. checkout beta, merge dev (no-ff), push origin beta" -echo " 2. create tag $VERSION and push it (triggers beta AMO + prerelease)" -echo " 3. checkout dev" +echo " 1. set manifest.json version to $SEMVER and commit on dev" +echo " 2. checkout beta, merge dev (no-ff), push origin beta" +echo " 3. create tag $TAG and push it (triggers beta AMO + prerelease)" +echo " 4. checkout dev" read -r -p "Continue? [y/N] " confirm [[ "${confirm:-}" =~ ^[yY](es)?$ ]] || { echo "Aborted."; exit 1; } -echo "πŸš€ Releasing beta $VERSION" +echo "πŸš€ Releasing beta $TAG" + +bump_manifest "$SEMVER" +git add manifest.json +git commit -m "Bump version to $SEMVER" git checkout beta git pull origin beta -git merge dev --no-ff -m "$VERSION" +git merge dev --no-ff -m "$TAG" git push origin beta -git tag -a "$VERSION" -m "$VERSION" -git push origin "$VERSION" +git tag -a "$TAG" -m "$TAG" +git push origin "$TAG" git checkout dev -echo "βœ… Done: beta $VERSION (merge + tag pushed)" +echo "βœ… Done: beta $TAG (manifest $SEMVER, merge + tag pushed)" From f106ab490a454c52748ca02404722a45d04ac222 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Wed, 1 Apr 2026 16:31:48 -0400 Subject: [PATCH 3/3] Bump version to 5.0.4 --- manifest.json | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index 9ffd2c9..6f94631 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Speeder", "short_name": "Speeder", - "version": "5.0.3", + "version": "5.0.4", "manifest_version": 2, "description": "Speed up, slow down, advance and rewind HTML5 audio/video with shortcuts (New and improved version of \"Video Speed Controller\")", "homepage_url": "https://github.com/SoPat712/speeder", @@ -9,7 +9,9 @@ "gecko": { "id": "{ed860648-f54f-4dc9-9a0d-501aec4313f5}", "data_collection_permissions": { - "required": ["none"] + "required": [ + "none" + ] } } }, @@ -19,9 +21,13 @@ "128": "icons/icon128.png" }, "background": { - "scripts": ["background.js"] + "scripts": [ + "background.js" + ] }, - "permissions": ["storage"], + "permissions": [ + "storage" + ], "options_ui": { "page": "options.html", "open_in_tab": false @@ -37,16 +43,27 @@ "content_scripts": [ { "all_frames": true, - "matches": ["http://*/*", "https://*/*", "file:///*"], + "matches": [ + "http://*/*", + "https://*/*", + "file:///*" + ], "match_about_blank": true, "exclude_matches": [ "https://plus.google.com/hangouts/*", "https://hangouts.google.com/*", "https://meet.google.com/*" ], - "css": ["inject.css"], - "js": ["inject.js"] + "css": [ + "inject.css" + ], + "js": [ + "inject.js" + ] } ], - "web_accessible_resources": ["inject.css", "shadow.css"] + "web_accessible_resources": [ + "inject.css", + "shadow.css" + ] }