fix(ci): exécuter prepack explicitement avant npm pack (embarquement @arboretum/shared)
Le job pack-smoke échouait sur le runner Gitea : « npm pack -w » n'y déclenche pas le hook prepack (contrairement à « npm publish -w », d'où la 1.2.0 publiée intacte). vendor-shared ne matérialisait donc pas @arboretum/shared, et npm retombait sur le symlink workspace (non bundlé) → tarball sans le runtime partagé. On lance désormais prepack explicitement, on vérifie la matérialisation de @arboretum/shared/dist/index.js, puis on packe en --ignore-scripts. On nettoie aussi /tmp/tarballs (runner persistant). Validé en repro locale (npm 10 et 11).
This commit is contained in:
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@@ -46,8 +46,18 @@ jobs:
|
||||
# et on l'installe seul, comme un vrai consommateur depuis le registre.
|
||||
- name: Pack tarball
|
||||
run: |
|
||||
mkdir -p /tmp/tarballs
|
||||
npm pack -w @johanleroy/git-arboretum --pack-destination /tmp/tarballs
|
||||
rm -rf /tmp/tarballs && mkdir -p /tmp/tarballs
|
||||
# Le hook prepack (copy-web + vendor-shared + copy-meta) matérialise
|
||||
# @arboretum/shared comme VRAI dossier dans le node_modules du serveur —
|
||||
# condition pour que npm l'embarque via bundleDependencies. Selon la version
|
||||
# de npm du runner, « npm pack -w » ne déclenche PAS toujours ce lifecycle
|
||||
# (contrairement à « npm publish -w », qui lance bien prepack). On l'exécute
|
||||
# donc explicitement, on vérifie la matérialisation, puis on packe avec
|
||||
# --ignore-scripts (prepack déjà fait, dossier physique présent → bundlé).
|
||||
npm run prepack -w @johanleroy/git-arboretum
|
||||
test -f packages/server/node_modules/@arboretum/shared/dist/index.js \
|
||||
|| { echo "ERREUR: prepack n'a pas matérialisé @arboretum/shared/dist/index.js"; exit 1; }
|
||||
npm pack -w @johanleroy/git-arboretum --pack-destination /tmp/tarballs --ignore-scripts
|
||||
ls -l /tmp/tarballs
|
||||
- name: Assert @arboretum/shared is bundled in the tarball
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user