Distribution: firefox-updates.json + CLAUDE.md (workflow Claude) + nettoyage secrets
- firefox-updates.json à la racine : manifest auto-update Firefox avec entrées v2026.5.40 et v2026.5.41 (sha256 NON SIGNÉ pour le moment, à remplacer par celui des .xpi signés AMO). - build.sh : maintient firefox-updates.json automatiquement à chaque build (ajoute ou met à jour l'entrée de la version courante avec son sha256 calculé sur le .xpi produit). - CLAUDE.md : workflow complet pour Claude Code (build → test → push → wiki → signature AMO). Token Gitea jamais dans le fichier (stocké hors repo en mémoire Claude .claude/projects/.../memory/gitea_token.md). - .gitignore : ajout _archives/, .claude/, .env, *.token, secrets.json. - README.md / CHANGELOG.md : retrait email auteur en clair (renvoi vers page wiki Contact, email obfusqué en entités HTML).
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
# Usage : ./build.sh
|
||||
###############################################################################
|
||||
set -e
|
||||
# Le script est dans Autres/ — on remonte d'un cran pour se placer à la
|
||||
# racine du projet, où se trouvent src/ et dist/.
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
VERSION=$(python3 -c "import json; print(json.load(open('src/manifest.json'))['version'])")
|
||||
@@ -44,6 +46,44 @@ cd dist/firefox && zip -rq "../planification-v${VERSION}-firefox.xpi" . && cd .
|
||||
echo ""
|
||||
echo "==> Builds prêts dans dist/"
|
||||
ls -la dist/*.zip dist/*.xpi 2>/dev/null
|
||||
|
||||
# ---- firefox-updates.json : ajout/mise à jour de l'entrée pour cette version
|
||||
# (sha256 du .xpi NON SIGNÉ — sera remplacé par celui du .xpi signé après AMO).
|
||||
python3 - <<EOF
|
||||
import json, hashlib, os
|
||||
xpi = f"dist/planification-v${VERSION}-firefox.xpi"
|
||||
with open(xpi, 'rb') as f: sha = hashlib.sha256(f.read()).hexdigest()
|
||||
|
||||
JSON_PATH = "firefox-updates.json"
|
||||
ADDON_ID = "planification@netaplaid.ch"
|
||||
update_link = f"https://gitea.netaplaid.ch/FroSteel/Planification/releases/download/v${VERSION}/planification-v${VERSION}-firefox.xpi"
|
||||
|
||||
if os.path.exists(JSON_PATH):
|
||||
with open(JSON_PATH) as f: data = json.load(f)
|
||||
else:
|
||||
data = {"addons": {ADDON_ID: {"updates": []}}}
|
||||
|
||||
addon = data.setdefault("addons", {}).setdefault(ADDON_ID, {"updates": []})
|
||||
updates = addon.setdefault("updates", [])
|
||||
|
||||
# Retirer toute entrée existante pour cette version (idempotent)
|
||||
updates = [u for u in updates if u.get("version") != "${VERSION}"]
|
||||
# Ajouter en tête
|
||||
updates.insert(0, {
|
||||
"version": "${VERSION}",
|
||||
"update_link": update_link,
|
||||
"update_hash": "sha256:" + sha,
|
||||
})
|
||||
addon["updates"] = updates
|
||||
|
||||
with open(JSON_PATH, 'w') as f:
|
||||
json.dump(data, f, indent=2, ensure_ascii=False)
|
||||
f.write('\n')
|
||||
|
||||
print(f" ✓ firefox-updates.json mis à jour (sha256 NON SIGNÉ : {sha[:16]}…)")
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo "Pour Chrome : charger dist/chromium/ en mode développeur"
|
||||
echo "Pour Firefox : signer dist/planification-v${VERSION}-firefox.xpi sur AMO"
|
||||
echo " Après signature, remplacer le sha256 dans firefox-updates.json par celui du .xpi signé."
|
||||
|
||||
Reference in New Issue
Block a user