Skip to content

Commit

Permalink
build: Add a workflow to auto publish the CLI to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed May 5, 2024
1 parent 27f45d5 commit 79777bd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -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 }}

2 changes: 1 addition & 1 deletion apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
1 change: 1 addition & 0 deletions tooling/github/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ runs:
with:
node-version: 21
cache: "pnpm"
registry-url: https://registry.npmjs.org

- shell: bash
run: pnpm add -g turbo
Expand Down

0 comments on commit 79777bd

Please sign in to comment.