From 30ca69c33dd04104c62fc5e14178938bca8fe564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Fri, 29 Dec 2023 04:27:34 +0100 Subject: [PATCH] NPM publish using Node container (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Julien Valverdé Reviewed-on: https://git.jvalver.de/Thilawyn/thilatrait/pulls/4 --- .drone.jsonnet | 21 +++++++++++++++++---- .gitignore | 1 - .npmignore | 10 ++++++++++ package.json | 2 +- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 .npmignore diff --git a/.drone.jsonnet b/.drone.jsonnet index 2a13019..71aa14f 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,4 +1,5 @@ local bun_image = "oven/bun:1"; +local node_image = "node:20"; local fetch_step = { @@ -25,14 +26,25 @@ local build_step = { commands: ["bun run build"], }; +local pack_step = { + name: "pack", + image: node_image, + commands: ["npm pack"], +}; + local publish_step = { name: "publish", - image: "plugins/npm", + image: node_image, - settings: { - registry: "https://git.jvalver.de/api/packages/jvalverde/npm", - token: { from_secret: "npm_token" }, + environment: { + NPM_TOKEN: { from_secret: "npm_token" } }, + + commands: [ + "npm set registry https://git.jvalver.de/api/packages/thilawyn/npm/", + "npm config set -- //git.jvalver.de/api/packages/thilawyn/npm/:_authToken $NPM_TOKEN", + "npm publish", + ], }; @@ -75,6 +87,7 @@ local publish_step = { install_step, lint_step, build_step, + pack_step, ], }, diff --git a/.gitignore b/.gitignore index ceaea36..745264f 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,3 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* - diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..1b733b1 --- /dev/null +++ b/.npmignore @@ -0,0 +1,10 @@ +/node_modules/ +/src/ +/.drone.jsonnet +/.gitignore +/.npmignore +/bun.lockb +/README.md +/rollup.config.js +/tsconfig.json +/tsconfig.tsbuildinfo diff --git a/package.json b/package.json index d0cc7dd..2e6f204 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "20231229.0.0", "type": "module", "publishConfig": { - "registry": "https://git.jvalver.de/api/packages/jvalverde/npm" + "registry": "https://git.jvalver.de/api/packages/thilawyn/npm/" }, "exports": { ".": {