mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-12 01:37:06 +02:00
Renommage AJEAN (2/3) : services, binaire et releases
Suite du renommage. Principe directeur : le code s'adapte a ce qui est DEJA installe sur la machine, plutot que d'exiger une migration privilegiee qui pourrait echouer et laisser un serveur sans service. Services (sys_unitname.go). Une mise a jour remplace le binaire, pas les unites systemd : un serveur deja installe tourne encore sous jean.service et jean-link.service. serviceName() et linkServiceName() resolvent donc le nom a l'usage — l'unite qui existe reellement — au lieu de supposer "ajean*". Sans ca, le premier systemctl restart apres MAJ echouerait, et sur un serveur distant ca veut dire l'acces coupe sans terminal pour reparer. Meme logique pour le label launchd, ou le prefixe com.jean. est conserve tant que c'est lui qui est charge. Le fichier PID du worker de lien est repris au passage (jean-link.pid -> ajean-link.pid) : c'est lui qui dit si un worker tourne, et sans reprise la premiere version renommee en aurait demarre un second, donnant deux tunnels concurrents vers le relais. Binaire. installedExePath vise desormais ajean(.exe), et l'installation pose un alias "jean" a cote — lien symbolique sous Unix, copie sous Windows ou les liens demandent des droits qu'on n'a pas toujours. La commande d'hier reste tapable : on ne controle ni les alias shell, ni les cron, ni les scripts de deploiement, ni les tutos deja ecrits. /etc/default/ajean est ecrit avec AJEAN_HOME ET JEAN_HOME, et l'ancien /etc/default/jean est laisse en place plutot que supprime : des scripts d'utilisateurs le sourcent. Releases. Les workflows produisent ajean-<os>-<arch> puis en copient un jeu jean-<os>-<arch> identique, une fois les binaires macOS recuperes. Les deux jeux sont dans SHA256SUMS. Ces copies sont indispensables : le parc installe ne sait chercher que jean-*, il ne pourrait donc meme pas atteindre la version qui apprend a lire ajean-*. A retirer quand le parc aura bascule. Le bundle devient AJEAN.app, avec le zip publie sous les deux noms pour ne pas casser les liens de telechargement deja diffuses. La detection du mode application se basant sur /Contents/MacOS et non sur le nom du bundle, elle n'est pas affectee.
This commit is contained in:
1 parent
110458c133
commit
3720b90173
11 files changed
+275
-99
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# Build macOS à la demande, SANS rien publier : produit Jean.app en artifact
|
||||
# Build macOS à la demande, SANS rien publier : produit AJEAN.app en artifact
|
||||
# téléchargeable depuis l'onglet Actions (visible seulement par le dépôt).
|
||||
# Sert à tester le bundle avant de décider d'une vraie release (release.yml).
|
||||
name: mac-build
|
||||
@@ -13,38 +13,38 @@ jobs:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
- name: build + bundle Jean.app (arm64)
|
||||
- name: build + bundle AJEAN.app (arm64)
|
||||
run: |
|
||||
mkdir -p dist
|
||||
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 \
|
||||
go build -trimpath -ldflags="-s -w" -o dist/jean-darwin-arm64 ./cmd/jean
|
||||
go build -trimpath -ldflags="-s -w" -o dist/ajean-darwin-arm64 ./cmd/ajean
|
||||
mkdir -p /tmp/jean.iconset
|
||||
sips -s format png 'cmd/jean/icon.ico' --out /tmp/icon.png >/dev/null 2>&1 || true
|
||||
for s in 16 32 128 256 512; do
|
||||
sips -z $s $s /tmp/icon.png --out "/tmp/jean.iconset/icon_${s}x${s}.png" >/dev/null 2>&1 || true
|
||||
done
|
||||
iconutil -c icns /tmp/jean.iconset -o /tmp/jean.icns >/dev/null 2>&1 || true
|
||||
app="dist/Jean.app"
|
||||
app="dist/AJEAN.app"
|
||||
mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources"
|
||||
cp dist/jean-darwin-arm64 "$app/Contents/MacOS/jean"
|
||||
chmod +x "$app/Contents/MacOS/jean"
|
||||
cp dist/ajean-darwin-arm64 "$app/Contents/MacOS/ajean"
|
||||
chmod +x "$app/Contents/MacOS/ajean"
|
||||
cp /tmp/jean.icns "$app/Contents/Resources/jean.icns" 2>/dev/null || true
|
||||
printf '%s\n' \
|
||||
'<?xml version="1.0" encoding="UTF-8"?>' \
|
||||
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' \
|
||||
'<plist version="1.0"><dict>' \
|
||||
'<key>CFBundleName</key><string>Jean</string>' \
|
||||
'<key>CFBundleDisplayName</key><string>Jean</string>' \
|
||||
'<key>CFBundleExecutable</key><string>jean</string>' \
|
||||
'<key>CFBundleIdentifier</key><string>link.ajean.jean</string>' \
|
||||
'<key>CFBundleIconFile</key><string>jean</string>' \
|
||||
'<key>CFBundleName</key><string>AJEAN</string>' \
|
||||
'<key>CFBundleDisplayName</key><string>AJEAN</string>' \
|
||||
'<key>CFBundleExecutable</key><string>ajean</string>' \
|
||||
'<key>CFBundleIdentifier</key><string>link.ajean.app</string>' \
|
||||
'<key>CFBundleIconFile</key><string>ajean</string>' \
|
||||
'<key>CFBundlePackageType</key><string>APPL</string>' \
|
||||
'<key>LSMinimumSystemVersion</key><string>11.0</string>' \
|
||||
'<key>LSUIElement</key><true/>' \
|
||||
'<key>NSHighResolutionCapable</key><true/>' \
|
||||
'</dict></plist>' > "$app/Contents/Info.plist"
|
||||
codesign --force --deep -s - "$app" || true
|
||||
(cd dist && zip -qry Jean-macos-arm64.zip Jean.app && rm -rf Jean.app)
|
||||
(cd dist && zip -qry AJEAN-macos-arm64.zip AJEAN.app && rm -rf AJEAN.app)
|
||||
ls -l dist
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
|
||||
@@ -29,11 +29,11 @@ jobs:
|
||||
mkdir -p dist
|
||||
# arm64 = natif ; amd64 = cross avec le SDK universel (-arch x86_64).
|
||||
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 \
|
||||
go build -trimpath -ldflags="-s -w" -o dist/jean-darwin-arm64 ./cmd/jean
|
||||
go build -trimpath -ldflags="-s -w" -o dist/ajean-darwin-arm64 ./cmd/ajean
|
||||
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 \
|
||||
CGO_CFLAGS="-arch x86_64" CGO_LDFLAGS="-arch x86_64" \
|
||||
go build -trimpath -ldflags="-s -w" -o dist/jean-darwin-amd64 ./cmd/jean
|
||||
file dist/jean-darwin-*
|
||||
go build -trimpath -ldflags="-s -w" -o dist/ajean-darwin-amd64 ./cmd/ajean
|
||||
file dist/ajean-darwin-*
|
||||
- name: bundles Jean.app
|
||||
run: |
|
||||
# Un binaire nu double-cliqué ouvrirait le Terminal. On publie donc
|
||||
@@ -43,29 +43,29 @@ jobs:
|
||||
# la barre de menus), comme le double-clic sur jean.exe sous Windows.
|
||||
# LSUIElement : app de barre de menus, aucune icône dans le Dock.
|
||||
# L'icône part du PNG 1024 généré avec le reste de la marque
|
||||
# (cmd/jean/icon.png, voir tools/gen-icon) : plus de conversion depuis
|
||||
# (cmd/ajean/icon.png, voir tools/gen-icon) : plus de conversion depuis
|
||||
# le .ico, dont l'échec silencieux donnait une app sans icône.
|
||||
mkdir -p /tmp/jean.iconset
|
||||
for s in 16 32 128 256 512; do
|
||||
sips -z $s $s 'cmd/jean/icon.png' --out "/tmp/jean.iconset/icon_${s}x${s}.png" >/dev/null
|
||||
sips -z $s $s 'cmd/ajean/icon.png' --out "/tmp/jean.iconset/icon_${s}x${s}.png" >/dev/null
|
||||
done
|
||||
iconutil -c icns /tmp/jean.iconset -o /tmp/jean.icns
|
||||
v="${GITHUB_REF_NAME#v}"
|
||||
for arch in amd64 arm64; do
|
||||
app="dist/mac-$arch/Jean.app"
|
||||
app="dist/mac-$arch/AJEAN.app"
|
||||
mkdir -p "$app/Contents/MacOS" "$app/Contents/Resources"
|
||||
cp "dist/jean-darwin-$arch" "$app/Contents/MacOS/jean"
|
||||
chmod +x "$app/Contents/MacOS/jean"
|
||||
cp /tmp/jean.icns "$app/Contents/Resources/jean.icns" 2>/dev/null || true
|
||||
cp "dist/ajean-darwin-$arch" "$app/Contents/MacOS/ajean"
|
||||
chmod +x "$app/Contents/MacOS/ajean"
|
||||
cp /tmp/jean.icns "$app/Contents/Resources/ajean.icns" 2>/dev/null || true
|
||||
printf '%s\n' \
|
||||
'<?xml version="1.0" encoding="UTF-8"?>' \
|
||||
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' \
|
||||
'<plist version="1.0"><dict>' \
|
||||
'<key>CFBundleName</key><string>Jean</string>' \
|
||||
'<key>CFBundleDisplayName</key><string>Jean</string>' \
|
||||
'<key>CFBundleExecutable</key><string>jean</string>' \
|
||||
'<key>CFBundleIdentifier</key><string>link.ajean.jean</string>' \
|
||||
'<key>CFBundleIconFile</key><string>jean</string>' \
|
||||
'<key>CFBundleName</key><string>AJEAN</string>' \
|
||||
'<key>CFBundleDisplayName</key><string>AJEAN</string>' \
|
||||
'<key>CFBundleExecutable</key><string>ajean</string>' \
|
||||
'<key>CFBundleIdentifier</key><string>link.ajean.app</string>' \
|
||||
'<key>CFBundleIconFile</key><string>ajean</string>' \
|
||||
'<key>CFBundlePackageType</key><string>APPL</string>' \
|
||||
"<key>CFBundleShortVersionString</key><string>$v</string>" \
|
||||
"<key>CFBundleVersion</key><string>$v</string>" \
|
||||
@@ -76,7 +76,11 @@ jobs:
|
||||
# Signature ad-hoc : sans elle, macOS refuse purement et simplement
|
||||
# de lancer un binaire arm64 non signé (pas juste un avertissement).
|
||||
codesign --force --deep -s - "$app" || true
|
||||
(cd "dist/mac-$arch" && zip -qry "../Jean-macos-$arch.zip" Jean.app)
|
||||
(cd "dist/mac-$arch" && zip -qry "../AJEAN-macos-$arch.zip" AJEAN.app)
|
||||
# Nom hérité conservé : les liens de téléchargement déjà publiés
|
||||
# (site, mails, messages) pointent dessus et doivent continuer de
|
||||
# fonctionner. Même contenu, deux noms.
|
||||
cp "dist/AJEAN-macos-$arch.zip" "dist/Jean-macos-$arch.zip"
|
||||
rm -rf "dist/mac-$arch"
|
||||
done
|
||||
ls -l dist
|
||||
@@ -102,16 +106,28 @@ jobs:
|
||||
# (l'app se rattache à la console du terminal parent si lancée en CLI).
|
||||
[ "$os" = windows ] && { ext=".exe"; ldflags="$ldflags -H=windowsgui"; }
|
||||
GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
|
||||
go build -trimpath -ldflags="$ldflags" -o "dist/jean-$os-$arch$ext" ./cmd/jean
|
||||
go build -trimpath -ldflags="$ldflags" -o "dist/ajean-$os-$arch$ext" ./cmd/ajean
|
||||
done
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: macos
|
||||
path: dist
|
||||
- name: assets hérités jean-* (transition)
|
||||
run: |
|
||||
# Le parc déjà installé ne sait chercher QUE « jean-<os>-<arch> » : sans
|
||||
# ces copies, aucun des utilisateurs actuels ne pourrait se mettre à
|
||||
# jour — pas même vers la version qui apprend à lire « ajean-* ».
|
||||
# Après cette étape SEULEMENT, donc une fois les binaires macOS
|
||||
# récupérés, les deux jeux de noms sont complets.
|
||||
# À supprimer quand le parc aura basculé (quelques versions).
|
||||
for f in dist/ajean-*; do
|
||||
cp "$f" "dist/jean-${f#dist/ajean-}"
|
||||
done
|
||||
ls -l dist
|
||||
- name: SHA256SUMS
|
||||
run: |
|
||||
chmod +x dist/jean-darwin-*
|
||||
(cd dist && sha256sum jean-* Jean-macos-*.zip > SHA256SUMS)
|
||||
chmod +x dist/ajean-darwin-* dist/jean-darwin-*
|
||||
(cd dist && sha256sum ajean-* jean-* *.zip > SHA256SUMS)
|
||||
ls -l dist && cat dist/SHA256SUMS
|
||||
- name: publier la release
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
||||
Reference in new issue
Block a user