2.4 KiB
2.4 KiB
Publier une release
Les installateurs one-liner (install.sh et install.ps1) téléchargent
les binaires attachés à la dernière release du dépôt Gitea
(https://git.dracodev.net/Projets/agent-manager). Sans binaire pour la
plateforme, ils retombent sur cargo install --git (plus lent mais toujours
fonctionnel).
1. Bumper la version
Dans Cargo.toml (ex. 0.2.1), puis mettre à jour Cargo.lock
(cargo check) et compiler :
cargo build --release # binaire Windows (am.exe) sur Windows
# binaire Linux STATIQUE (musl) : compatible toutes distributions,
# y compris Debian 12 (glibc 2.36) — ne JAMAIS publier un binaire glibc
# compilé sur une base récente.
docker run --rm -v "${PWD}:/work" -w /work -e CARGO_TARGET_DIR=/tmp/target-musl \
rust:1.94-alpine sh -c "apk add --no-cache build-base && \
rustup target add x86_64-unknown-linux-musl && \
cargo build --release --locked --target x86_64-unknown-linux-musl && \
cp /tmp/target-musl/x86_64-unknown-linux-musl/release/am dist/am-linux-x86_64"
2. Créer les archives des binaires
Windows (PowerShell) :
Compress-Archive target\release\am.exe am-windows-x86_64.zip
Linux (l'archive doit contenir un fichier nommé « am ») :
docker run --rm -v "${PWD}:/work" -w /work rust:1.94-alpine sh -c \
"cd dist && cp am-linux-x86_64 am && tar -czf am-linux-x86_64.tar.gz am && rm am"
3. Créer la release sur Gitea
Via l'interface web : Releases > New Release, tag v0.2.0, attacher les archives ci-dessus.
Ou via l'API (jeton Gitea requis) :
curl -X POST -H "Authorization: token <JETON>" \
-H "Content-Type: application/json" \
-d '{"tag_name":"v0.2.0","name":"v0.2.0","body":"notes de version"}' \
https://git.dracodev.net/api/v1/repos/Projets/agent-manager/releases
curl -X POST -H "Authorization: token <JETON>" \
-F "attachment=@am-windows-x86_64.zip" \
https://git.dracodev.net/api/v1/repos/Projets/agent-manager/releases/<id>/assets?name=am-windows-x86_64.zip
curl -X POST -H "Authorization: token <JETON>" \
-F "attachment=@am-linux-x86_64.tar.gz" \
https://git.dracodev.net/api/v1/repos/Projets/agent-manager/releases/<id>/assets?name=am-linux-x86_64.tar.gz
4. Tag git
git tag v0.2.0 && git push origin v0.2.0
Les conventions de nommage attendues par les installateurs :
- am-windows-x86_64.zip (contient am.exe)
- am-linux-x86_64.tar.gz (contient am)