aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-05-05 12:14:07 +0100
committerMohamedBassem <me@mbassem.com>2024-05-05 12:21:00 +0100
commit79777bd7e259596b50e66096bae5262893f45af7 (patch)
tree01d7df6d920af4ba76f6aedec31cc9bfcbf1cea7
parent27f45d595be3bccc94e79f623c07555d62fa54ec (diff)
downloadkarakeep-79777bd7e259596b50e66096bae5262893f45af7.tar.zst
build: Add a workflow to auto publish the CLI to npm
-rw-r--r--.github/workflows/cli.yml24
-rw-r--r--apps/cli/package.json2
-rw-r--r--tooling/github/setup/action.yml1
3 files changed, 26 insertions, 1 deletions
diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml
new file mode 100644
index 00000000..b40d99cc
--- /dev/null
+++ b/.github/workflows/cli.yml
@@ -0,0 +1,24 @@
+name: Publish CLI Package to npm
+on:
+ push:
+ tags:
+ # This is a glob pattern not a regex
+ - 'cli/v[0-9]+.[0-9]+.[0-9]+'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Setup
+ uses: ./tooling/github/setup
+
+ - name: Build CLI
+ run: pnpm build
+ working-directory: apps/cli
+
+ - run: pnpm publish --access public --no-git-checks
+ working-directory: apps/cli
+ env:
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
+
diff --git a/apps/cli/package.json b/apps/cli/package.json
index 21d7a794..4500e75a 100644
--- a/apps/cli/package.json
+++ b/apps/cli/package.json
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@hoarderapp/cli",
- "version": "0.13.0",
+ "version": "0.13.2",
"description": "Command Line Interface (CLI) for Hoarder",
"license": "GNU Affero General Public License version 3",
"keywords": [
diff --git a/tooling/github/setup/action.yml b/tooling/github/setup/action.yml
index 9a8ff513..c0b3d85c 100644
--- a/tooling/github/setup/action.yml
+++ b/tooling/github/setup/action.yml
@@ -9,6 +9,7 @@ runs:
with:
node-version: 21
cache: "pnpm"
+ registry-url: https://registry.npmjs.org
- shell: bash
run: pnpm add -g turbo