release: @johanleroy/git-arboretum 1.0.0 — publication sur le registre Gitea
Some checks failed
Release / Publish to Gitea npm registry (push) Has been cancelled
Some checks failed
Release / Publish to Gitea npm registry (push) Has been cancelled
- renomme le paquet en @johanleroy/git-arboretum (scope routé vers le registre npm Gitea privé) - embarque @arboretum/shared via bundleDependencies (scripts/vendor-shared.mjs au prepack) - joint README/LICENSE au tarball (scripts/copy-meta.mjs) + metadata, keywords, publishConfig - CI pack-smoke en mono-tarball avec assertion bundleDep ; nouveau workflow release.yml (publish sur tag v*) - version 1.0.0 ; README mis à jour (install scopé + service systemd)
This commit is contained in:
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@@ -41,14 +41,21 @@ jobs:
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
# @arboretum/shared est une dépendance runtime non publiée : on packe les
|
||||
# deux tarballs et on les installe ensemble dans un projet vierge.
|
||||
- name: Pack tarballs
|
||||
# @arboretum/shared (dépendance runtime non publiée) est embarquée dans le tarball
|
||||
# via bundleDependencies (matérialisée au prepack). On packe donc UN SEUL tarball
|
||||
# et on l'installe seul, comme un vrai consommateur depuis le registre.
|
||||
- name: Pack tarball
|
||||
run: |
|
||||
mkdir -p /tmp/tarballs
|
||||
npm pack -w @arboretum/shared -w git-arboretum --pack-destination /tmp/tarballs
|
||||
npm pack -w @johanleroy/git-arboretum --pack-destination /tmp/tarballs
|
||||
ls -l /tmp/tarballs
|
||||
- name: Install tarballs in an empty project
|
||||
- name: Assert @arboretum/shared is bundled in the tarball
|
||||
run: |
|
||||
tgz=$(ls /tmp/tarballs/*.tgz)
|
||||
tar -tzf "$tgz" | grep -q 'node_modules/@arboretum/shared/dist/index.js' \
|
||||
|| { echo "ERREUR: @arboretum/shared non embarqué dans $tgz"; exit 1; }
|
||||
echo "OK: bundleDependency @arboretum/shared présente dans $tgz"
|
||||
- name: Install tarball in an empty project
|
||||
run: |
|
||||
mkdir /tmp/smoke
|
||||
cd /tmp/smoke
|
||||
|
||||
42
.github/workflows/release.yml
vendored
Normal file
42
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# Publication du paquet @johanleroy/git-arboretum sur le registre npm du Gitea,
|
||||
# déclenchée UNIQUEMENT par un tag vX.Y.Z (jamais sur un push de branche).
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ['v*']
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish to Gitea npm registry
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
registry-url: 'https://git.lidge.fr/api/packages/johanleroy/npm/'
|
||||
scope: '@johanleroy'
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
# Garde-fou : le tag (sans le "v") doit correspondre à la version du paquet.
|
||||
# GITHUB_REF_NAME est une variable d'env du runner (pas d'interpolation ${{ }} dans le shell).
|
||||
- name: Verify tag matches package version
|
||||
run: |
|
||||
pkg=$(node -p "require('./packages/server/package.json').version")
|
||||
tag="${GITHUB_REF_NAME#v}"
|
||||
if [ "$pkg" != "$tag" ]; then
|
||||
echo "ERREUR: tag '$tag' != version paquet '$pkg'"
|
||||
exit 1
|
||||
fi
|
||||
echo "OK: tag $tag == version $pkg"
|
||||
- run: npm publish -w @johanleroy/git-arboretum
|
||||
env:
|
||||
# Mapper le secret du registre (PAT Gitea write:package, ou le token auto
|
||||
# GITEA_TOKEN s'il a ce scope) sur NODE_AUTH_TOKEN lu par le .npmrc de setup-node.
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
Reference in New Issue
Block a user