From d6010832792dc5e1657d7340f6774c3743d82c90 Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Sun, 14 Jul 2024 23:39:53 +0200 Subject: [PATCH] Configure JS package publish and Woodpecker CI build. --- .woodpecker.yaml | 17 +++++++++++++++++ .woodpecker/yarn_auth.sh | 6 ++++++ .yarnrc.yml | 5 +++++ package.json | 6 ++++++ 4 files changed, 34 insertions(+) create mode 100644 .woodpecker.yaml create mode 100755 .woodpecker/yarn_auth.sh diff --git a/.woodpecker.yaml b/.woodpecker.yaml new file mode 100644 index 0000000..510c277 --- /dev/null +++ b/.woodpecker.yaml @@ -0,0 +1,17 @@ +steps: + - name: build_library + image: node:alpine + volumes: + - /tmp/woodpecker/cache/uikernel/core/node_modules:/woodpecker/src/code.zeptotech.net/UIKernel/Core/node_modules + - /tmp/woodpecker/cache/uikernel/core/.yarn/cache:/woodpecker/src/code.zeptotech.net/UIKernel/Core/.yarn/cache + secrets: + - FORGE_TOKEN + commands: + - corepack enable + - yarn install + - yarn build + - ./.woodpecker/yarn_auth.sh + - yarn npm publish + when: + - event: tag + ref: refs/tags/v* diff --git a/.woodpecker/yarn_auth.sh b/.woodpecker/yarn_auth.sh new file mode 100755 index 0000000..b8ec0ea --- /dev/null +++ b/.woodpecker/yarn_auth.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "npmRegistries: + //code.zeptotech.net/api/packages/UIKernel/npm/: + npmAlwaysAuth: true + npmAuthToken: \"$FORGE_TOKEN\"" > ./.yarnrc.yml diff --git a/.yarnrc.yml b/.yarnrc.yml index 3186f3f..9d1e1e6 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -1 +1,6 @@ nodeLinker: node-modules + +npmScopes: + kernelui: + npmPublishRegistry: "https://code.zeptotech.net/api/packages/UIKernel/npm/" + npmRegistryServer: "https://code.zeptotech.net/api/packages/UIKernel/npm/" diff --git a/package.json b/package.json index b4dc24d..7634712 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,12 @@ "source": "index.ts", "types": "lib/index.d.ts", "main": "lib/index.js", + "files": [ + "lib/**/*" + ], + "publishConfig": { + "@kernelui:registry": "https://code.zeptotech.net/api/packages/UIKernel/npm/" + }, "dependencies": { "@floating-ui/react": "^0.26.17", "@fontsource-variable/jetbrains-mono": "^5.0.21",