From cd777f50aaa620c7a42ad3f2107c58da30ae2d38 Mon Sep 17 00:00:00 2001 From: Paul Hitt Date: Mon, 28 Sep 2026 16:42:02 -0400 Subject: [PATCH] Publish to the GitLab package registry on version tags The README's install line failed: the package was never published, and nothing told npm where the @extant2000 scope lives. A tag like v1.2.3 now publishes to this project's registry with CI_JOB_TOKEN, and the README sets the scope's registry before installing. Co-Authored-By: Claude Opus 5.5 --- .gitlab-ci.yml | 17 ++++++++++++++++- README.md | 4 ++++ package.json | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5a37d2..0b43836 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,21 @@ -stages: [test] +stages: [test, publish] test: stage: test image: node:22-alpine script: [npm ci, npm run build, npm test] + +# Publishes to this project's package registry on a version tag (v1.2.3). +# CI_JOB_TOKEN has write access to the project's own registry, so no stored +# secret is needed. +publish: + stage: publish + image: node:22-alpine + rules: + - if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/ + script: + - npm ci + - npm run build + - echo "@extant2000:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc + - echo "${CI_API_V4_URL#https:}/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc + - npm publish diff --git a/README.md b/README.md index 7d8a784..3212354 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,11 @@ The building blocks are exported too: `requirementIssues()`, ## Install +The package is published to the GitLab package registry, so point the +`@extant2000` scope there first: + ``` +npm config set @extant2000:registry https://gitlab.com/api/v4/packages/npm/ npm install @extant2000/mission-synth ``` diff --git a/package.json b/package.json index 35e05da..097af65 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ "README.md", "LICENSE" ], + "publishConfig": { + "@extant2000:registry": "https://gitlab.com/api/v4/projects/87000319/packages/npm/" + }, "repository": { "type": "git", "url": "https://gitlab.com/extant2000/mission-synth.git"